Running multiple .NET Core application on same port under IIS Express for development - asp.net-core

We are migrating a Webforms application based on .NET framework to .NET Core 5. As a part of the process we have decided to break down the single big app into multiple smaller application. As a first step we want to move the Login feature into a separate .NET Core app. This login app will authenticate users and will issue auth-cookie which will be used by the other apps and the old webforms application as well.
For this auth-cookie sharing to work and for other reasons, I need to get all the web apps running on same port but under different virtual directories. For example
http://localhost:5000/ -> This will be the old webforms app
http://localhost:5000/login -> This will be .NET Core login app
http://localhost:5000/admin -> This will be say .NET core admin app
I know we can set this up easily in production environment using IIS virtual applications or with azure front door etc. But we want to enable an all local (no internet needed) development setup which is also very easy to get up and running.
Is it possible to configure .NET core and IIS Express to behave like this on a single machine? All our developers use Windows 10 Home/Pro. Nobody has IIS installed on their dev boxes and we prefer to keep it that way.

Related

IIS + ASP.NET Core 6 + Hosting Pack resulting in default document/directory listing error

I'm attempting to get IIS to serve our ASP.NET 6 web application, but every time it complains of needing a default document. If I run the exe (kestrel) one it will serve it, but we want it to be hosted by IIS with the other components of the site.
I installed the 6.0.10 runtime w/ hosting package and these are the results when listing runtimes:
When looking at the site modules, I think it should have what is needed (think the AspNetCoreModuleV2 one handles the compiled routing scenario?):
Have rebooted the server and the app pool specifically, set to No Managed Code, and whenever I attempt to load the page at the localhost level, I get:
The views are compiled so I don't think I even need IIS to open views locally in any capacity.
Everything you've posted ticks off the major deployment steps for hosting a .NET 6 project on IIS:
Installed the .NET Core 6.0 Runtime Windows Hosting Bundle
Set up the IIS app pool with "No Managed Code"
Rebooted the server: "Have you turned it off and on again?"
After our exchange in the comments, the only thing that appeared to be missing is to use the .NET publish command; not the build command.
When deploying to IIS, you'll want to run the dotnet publish command and then deploy those artifacts to your IIS server. From the docs:
The dotnet publish command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution. It's the only officially supported way to prepare the application for deployment. Depending on the type of deployment that the project specifies, the hosting system may or may not have the .NET shared runtime installed on it.
You also may want to review: Publish .NET apps with the .NET CLI.

Is there any way that I can host .net core API's or .net core web APP on "on premises" server

I wanted to host my .net core API in Go Daddy Linux Server and also .net Core Web APP is there any possibility to do that. Also I have seen lots of tutorials to make that happen in Linux server which is for cloud but doesnt work the same scenario for any another on premises server.
If anyone have this experience or can only suggest that if there is possibility for hosting in the go daddy linux server it will be really helpful
It seems that you need to ask them whether they have support .net core on their Linux hosting package. I ever worked with them in the past 8 years ago, I didn't like their support, but I don't know now, maybe they improve better. If you want to use .net core on Linux, Digital Ocean can be good option. I also .net user here but I always use Windows to deploy my .net. From Classic ASP until newest .net core project, I always use Windows Server.

How to start a released Asp.net Core project?

I'm an asp.net developer and recently trying to archive asp.net-core.
Since it's quite new, I would like to ask, how do you launch a asp.net-core project in a Windows machine?
For normal asp.net, my approach is publishing the project using Visual Studio, bring everything to a Windows machine, use IIS to create a website and point the directory to my physical file.
How about a website that created by asp.net-core?
Do I need to install asp.net-core in server machine? (i don't prefer this)
What should I do with the published file? There are two folders generated after publishing the project:
netcoreapp1.0
PublishOutput
Well, you still can use the file system mechanism to publish an ASP.NET Core project from Visual Studio. But VS uses the dotnet CLI under the hood to do the same stuff. Usually you configure your deployment depending upon your hosting environment such as Windows Server and Linux Server.
For Windows Server
You have to install ASP.NET Core Module in order to publish on IIS successfully. This will also install .NET Core SDK. You can than have the advantages of SSL Terminations and others provided by IIS on Windows Server.
For Linux
You have to use the .NET Core SDK here as well for a published app to acquire the .NET Core runtime (This is why you get those 2 folders). You use Nginx or HAProxy to get all SSL Terminations, Port-Forwarding etc.

Do i need to install asp.net mvc4 on iis server

I am going to deploy my application tomorrow ,so i have few questions.I want to deploy asp.net mvc4 application on 2003 server where .net framework 4.0 is installed.My question is do i need to install asp.net mvc4 also there.Or if i copy the dll responsible for mvc in to that system is sufficient?
another question is i am using entityframework and oracle database so using ODP.NET, if this is the case do i need to install ODP.NET over there or just copying DLL system.dataaccess dll is sufficient?
Rest all i follow this two links will it work
The two links are http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx/
How to deploy MVC application in 2003 server IIS
UPDATE
today i tried and unfortunately i came to know that the framework which i was running .net 4.5 will not be supported in 2003.I made my project in to .net 4.0 and everything working fine in local system,but remote system lot of errors are coming.Method not found etc. I came to know that i have to degrade EF 5.0 to 4.4 i did it like replaced dll and changed one line begin with section but no luck as of now.I have to change somewhere else also.Do you know any proper mechanism which i need to carry forward for this?
No need to install anything explicitly except .Net 4.0. All you need is make sure that all dependencies (assemblies) of your application i.e. MVC, ODP.Net etc are present in bin directory of your application. Also make sure that ASP.Net v4.0 Web service extension is enabled in IIS.
Steps to enable web service extension.
Open IIS 6.0 Manager
Click Web Service Extensions
Enable ASP.NET 4.0
Check below screenshot.

Convert an ASP.NET application on production in II6, back to Solution

I have to modify an ASP.NET Web Forms application which is currently on production on a Windows Server 2003 in II6.
The problem is that I didn't develop the application and there is not anymore the Visual Studio solution used to develop the application. Moreover the application lies under a website where other applications are running and the connection strings are stored in the global web config file.
I want to modify the application without compromising the version that is actually online.
How can I bring the production version back into a solution file? Many thanks