IIS settings for OutOfProcess .NET Core Application - c#

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]

Related

.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

Asp.Net Core 3.1 produces .exe file that can't be deleted

I have an asp.net core 3.1 web api (running in IIS) that I've built that produces a .exe file. I'm using OutOfProcess hosting model.
Recently it's started becoming impossible to remove and replace, no matter what is done.
Previously we used an app_offline.htm file, which should disable the app and allow the entire folder to be cleared out, but it looks like no matter what's done the .exe file is never allowed to be deleted, even disabling the IIS app pool or website doesn't do it.
The Out-Of-Process hosting model even if is set to run under IIS in fact the IIS HTTP Server won't be used. Instead Kestrel web server is used to process your requests. So, ASP.NET Core Module forwards your requests to Kestrel web server. For more details about InProcess and OutOfProcess there is a nice article here.
Open powershell and try to kill all instances of the kestral server like this:
Get-Process -Name *dotnet* | Stop-Process

Unable to run ASP.NET Core rc2 in IIS

So, I've been trying to publish my Core App to local IIS server but whatever I do it just doesn't want to run.
What I do is find the project in windows explorer and open a command window there, and write the following:
dotnet publish --framework netcoreapp1.0 --output "C:/ReleaseWebsite" --configuration Release
Which well executes without any errors, and finally says that it published the project correctly.
After that I go to IIS and Add New Website, set it to port 80 or 8080, I even tried with 8088, and after set the path to the published files, I edit the Application Pool and set it to No Managed Code. Start the website but all I get it 500 error An error occurred while starting the application.
If I go manually to the published files and open GST.Web.exe it starts without any issues, and rusn on port 5000 and I can access it without any problems. But I want to run it in IIS. Any help?
Refer Publishing to IIS article.
I think you must have done all the steps from this article except installing .NET Core Windows Server Hosting bundle on the server.
Install the .NET Core Windows Server Hosting bundle on the server.
This bundle will install the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The module creates the reverse-proxy between IIS and the Kestrel server.
See if this helps.

MVC .NET Web service no access to Sharepoint Site on deploy mode

I'm developing a web service MVC .NET application that access to a Sharepoint 2013 site, I'm using the Microsoft.Sharepoint.dll not the client dll. When I run my web service on VS2015 in the IIS Express in release and debug mode I donĀ“t have any problem, but when I deploy the app to my local IIS the web service return an error
The Web application at http://[URL to SharePoint]/ could not be found.
I've tried running it with different URL such as http://localhost/sites/mysite and by domain name http://domain/sites/mysite, and I got the same results, on my VS IIS Express runs without problems but on the deploy IIS not.
The app is running on Framework 4.5 and AnyCpu compilation, I've tried downgrading the framework to 3.5 but without success. What could be the problem?, Is there any special permissions on the VS IIS that I need to enable on my local IIS?
I resolved deploying my application on a new web site in the IIS with the same applicattion pool used by my Sharepoint web site

Web API 2 get up and running on local IIS

I have Web API 2 C# project which runs fine through visual studio. I type URL to test like this:
http://localhost:51754/api/email/1
It shows me XML file. However when I publish and set up IIS I get
HTTP Error 403.14 - Forbidden.
I am new to this and my question is what kind of configuration I need to have it run on IIS. I am using .NET Framework Version 4.0 Integrated Application Pool to run it.
Probably ASP.NET is not registered within your IIS. Try running the following command from a DOS prompt with elevated user account:
C:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
Obviously you might need to adapt the path to aspnet_regiis.exe depending on your specific OS and version of the framework. Once you have registered ASP.NET 4.0 with IIS make sure that you restart it for changes to take effect:
iisreset

Categories