VS2017: multiple asp.net core projects debug - asp.net

We are migrating our project www.SampleProject.com from VS2013 into VS2017, also considering upgrade into ASP.NET Core. Project has following structure:
some class library projects (BLL and DAL)
API (WebAPI2 project)
UI (asp.net project with NG 1.4 used)
During debug:
Primary start-up project is UI, starting on localhost:52000
Second start-up project is API, starting on localhost:52000/API/
Such configuration allows us to debug both projects simultaneously, which is handy.
Also, this separation allows us to deploy API as separate REST API service (api.SampleProject.com) and also use API internally for UI (app.SampleProject.com/api)
In production environment, 'internal API' is configured in IIS as nested application in UI project.
However, this is not working with ASP.NET Core and VS2017.
Is there any known way how to debug two ASP.NET Core projects on same port (as described above)?
Thanks a lot

Related

How to deploy ASP.NET project with Angular 13 frontend to IIS?

I am trying to setup the solution for a web application which uses ASP.NET with .NET Framework 4.8 for the backend and Angular 13 for the frontend (we cannot use .NET Core or any newer version because some of the libraries we need to use are only available for .NET Framework).
In the solution, the angular project is in the same folder as the backend project (where the sln file is also located). Now, I created a publish profile for the backend project but it is not yet linked to the angular project in any way, so the output folder only contains the files for the backend. In addition to that, I built the angular frontend via ng build which generated all of the files I need for the frontend in the dist folder.
How can I deploy this to an IIS webserver so users can see and work with the angular frontend and all http requests to the backend are routed to the appropriate controller and action in my ASP.NET application? Are there any tutorials or instructions for this? So far, I was not able to find what I am looking for and I am very confused how I am supposed to make this work in IIS.

On premise application configuration service for .NET Core

I am searching for an on-premise solution where I can call my application settings for my .NET Core apps from an external service like the Amazon.Extensions.Configuration.SystemsManager provides.
With this solution I want to share secrets/settings across apps and environments.

Deploying Angular 9 .NET Core template in IIS

I'm trying to deploy .net core app with Angular, a project I created from the template available in Visual Studio.
The application I have in IIS is set to run from the angular app
Now within the same application, I added api application which is pointing to the api folder:
While I'm able to access the angular app, when I'm trying to login by calling the controller in the .net core application I'm getting this error:
System.InvalidOperationException: The SPA default page middleware
could not return the default page '/index.html' because it was not
found, and no other middleware handled the request. Your application
is running in Production mode, so make sure it has been published, or
that you have built your SPA manually. Alternatively you may wish to
switch to the Development environment.
Previously, when I was working with angular and .net core I had one project in VS for the .net core app and one project for the angular app and they were running from different subdomains, for example app.mywebsite.com for the angular app and api.mywebsite.com for the .net core app and I didn't have issues.
I was hoping with the .net core / Angular template I'll be able to run both the app and the api from one project but I'm currently experiencing the issues I mentioned above.

Deploy Web-Api, Asp.net project and a Windows service in one msi project

Is it possible to deploy ;
1- a web-api project
2- a website written in Asp.net
3- a WCF service as windows service
in one msi file using/in Windows Web Installer Project (preferably) or in Wix ?
Yes, it is possible using WiX. I maintain an open source project called IsWiX that even makes it somewhat easy. See:
Create and Package a Windows Service using IsWiX
IsWiX Web Site Demo
The concept behind IsWiX is project templates (scaffolding) and graphical designers that give you a project structure and most heavy lifting for your WiX MSI project. The template already contains examples of IIS configuration that merely need to be uncommented out. If you need a Web API and a Web Site you'll have to clone that part of the code and make a few adjustments. For example a static website typically won't be a web application where a web-api will be. Then you'll use the services designer to define the windows service. The fact that the service hosts a WCF endpoint really doesn't matter.
For that matter, one of the really cool things about WCF is it's possible to eliminate your dependencies on IIS. I've seen solutions using this with no dependency on IIS and this really makes creating installers a lot simpler.

Windows Application Web service not working

I have upgraded my asp.net application from framework 2.0 to 4.0 and with this stated I am also running one web service which is in framework 2.0.
On deploying to the server, I am not able to get the output of the web service while application is running alright
Do I need to upgrade the version of web service too?
And any change in app.config file required?
The easiest way forward is going to be to upgrade the web service to v4.x as well. Each application pool can only be tied to a single version of the .Net framework. It is technically possible to host a 2.x application inside of a 4.x site, but it will save a lot of trouble in the long term to standardize on a single version of the framework.
As This article describes:
If an IIS Web application that targets the .NET Framework 3.5 or
earlier is nested inside an IIS Web application that targets the .NET
Framework 4, the compiler might report errors when it compiles the
nested application. This is because Web.config files inherit settings
from files that are higher in the configuration file hierarchy.
If you don't want to upgrade the service, your best bet is to prevent web.config inheritance. This blog post has details on a few different ways to accomplish this.

Resources