IIS Application Initialization doesn't start my C# .net 6.0 application - c#

I want my C# .net 6.0 application to auto start after server restart or after application pool recycle. I am using clean architecture and react as a frontend. I have published my application on ISS, enabled auto-start, but application doesn't load without opening it's site on a web browser.
I have published my .net 6.0 application on production environment, which consist of:
Windows Server 2016 Datacenter
IIS version 10.0.14393.0. (I have installed Application Initialization feature).
On Appliction Pool of my app i have:
apppool settings
On Site of my app i have:
appsite settings
Problem is: I can't start or auto-start my app without opening its url on web browser. Without opening browser I can't even load my Program class with Main method. I want my app to load with IIS after shutdown or after recycle automatically without needing me to open it's site on browser. Maybe IIS could open my app site automatically. Inside my app in Startup I have some quartz jobs, that will load for now only after I opened my app site in browser. Without opening my app in browser Startup doesn't even load.
I tried Any way to start IIS App (Website) automatically?
but adding InProcess haven't worked.
I tried asp.net application does not auto-start
but System.Web.Hosting.IProcessHostPreloadClient is not available in .net 6.0. Also var client = new WebClient() is obsolete and doesn't work
I have similar problem like described in comment
How to properly autostart an asp.net application in IIS10
I want my app to auto start while being on IIS. Maybe IIS could open ap site? Maybe in launchsettings.json there is an option, to load app without opening browser?
Thank you for your help in advance

Related

IIS settings for OutOfProcess .NET Core Application

I would like to try OutOfProcess hosting for .NET Core Web App (.NET 5) in IIS 8.
I thought all I need to do is to change hosting model to outofprocess in web.config and IIS will forward request to Kestrel which would host the app.
When I use inprocess hosting model, website is accessible at http://localhost:8080/Test2.
When I change hosting model to outofprocess http://localhost:8080/Test2 returns HTTP error 502.5 as captured on screen below. Manually starting the app from command line with
dotnet myApp.dll
makes application available at http://localhost:5000 but I would like to access it thru IIS port.
What do I need to do to access .NET Core App thru IIS when App hosting model is outofprocess?
I've installed hosting bundle for .NET5 and .NET6.
I restarted IIS after configurations change.
I've set folder permission for application pool account, also for
"everyone" group.
Reading MS documentation I guess it is not possible to host application like this without modifications to app source code and publishing it again. To be honest I don't understand this article entirely.
Current host settings [Windows Server 2012 R2]

How to run ASP.NET MVC project without IIS on pc?

I have developed an ASP.NET MVC web project. I want to run my web project without IIS.
How to do this? I do not have a server computer.
You can use IIS even though you do not have server computer, you can run it on your computer IIS. Windows comes with IIS feature, you just need to enable it. You can refer to this document about how to enable IIS of your windows computer.
If you do not want to use IIS although you can enable IIS of windows, the post provided by M. Mohabbati is a solution which you can refer to.

.NET5 WebApi project infinite loading on IIS

I recently created an API that will be hosted on a local machine to our intranet. It is built as a .net core webapi project targeting .NET5
I deployed it to IIS using an App pool with the No managed code setting. And I added Authenticated Users as well as IIS_IUSRS to security.
Now when I try post to the api it just keeps loading, and in browser if I open a request it also just loads to no end.
Thanks

App pool crash : IIS Express vs Local/Server IIS

I have improved some external dll in a web API application. If I run it using Visual Studio's IIS Express then it works fine. But if I depoy it to local or server IIS then App is crashing the App pool. Is there any way to find the problem?
Application is crashing, when I call constructor of external dll.
I changed app pool settings on local/server IIS.
Open IIS - Application Pools - select your application's app pool - advanced settings
Set
Identity : LocalSystem
Rapid-Fail Protection - Enabled : False
I don't know how but it fixed my issue.

Publishing a c# console application on IIS Server

Is it possible to deploy a console c# application on IIS Server.
I have one .exe file running on a machine which takes data from named pipe and my c# application takes this data from the pipe and send it to the web application running using TCP sockets, I want to know if i can deploy my C# console application on the webserver?
I am new to ASP.net and C#.
You can host an exe file on IIS server, but it is not a common practice to deploy C# console applications,
In this way you don't know if the client machine has proper .NET Framework installed. So the console application may not even launch.
The web browser can simply block the download.
Even if the exe file is downloaded, unless the user launches it locally, it won't run automatically.
Recommended approach by Microsoft is to deploy the client side application using ClickOnce,
http://msdn.microsoft.com/en-us/library/t71a733d%28v=vs.80%29.aspx
You can then host the ClickOnce installer on IIS side. For example, Microsoft CodePlex uses this kind of deployment for its open source projects,
http://codeplex.codeplex.com/wikipage?title=ClickOnce
No, IIS can be used to host only web sites or web applications. You can't host console applications in IIS.

Categories