Posts

Showing posts from March, 2018

Angular run multiple apps in 1 project, Optionality bootstrap components

most posts you'll find talk about actually managing 2 totally different apps under 1 project, and that's best described here: https://yakovfain.com/2017/04/06/angular-cli-multiple-apps-in-the-same-project/ .

but what i really want to achieve is behavior more close to angular 1.x where you could write like 50 directives / components and put just set the ng-app attribute in your Aspx master page and it would just catch whatever is in, so in each page there were 2-10 directives and all was good.

with the angular-cli today its not native possible, but kouasda found a solution, where you test the page for the your angular tags and bootstrap them accordingly, as told in this issue and shown in this plnk.

eventually your app.module should look like this

import {BrowserModule, DOCUMENT} from '@angular/platform-browser'import {NgModule, Inject, ApplicationRef} from '@angular/core'import {AppRootOne} from './app-root-one.component'import {AppRootTwo} from './a…

c# WebRequest error An existing connection was forcibly closed by the remote host

“An error occurred while making the HTTP request to https://<API endpoint>. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.” Inner exception was “Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

this happened to me when doing some HttpWebRequests and suddenly everything stopped working.

apparently the server changed protocol to Tls1.2, and that caused all the mess. PLUS i was using .Net4 so no enum there, so here is the magic line for all you problems

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;