IIS Application pools CLR v4.0 vs No managed code - iis

I am currently developing an app which uses .Net core.
I have hosted a lot of micro-services on IIS Manager in new app pool.
I was wondering is there any advantages for app pool version instead of the latest.NET CLR v4.0, to use no managed code?
I heard some things that no managed code option gets better performance. Is that true?
Thank you.

You should use "No managed code" if only an ASP.NET Core app is hosted,
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1
The official guide has made it clear.

Related

How to host a asp.net core MVC app in IIS?

I am familiar with .Net in general but new to ASP.Net Core. I just had my first "self-hosted" ASP.Net Core MVC app running (created using templet and runs under Kestrel by default) . What I would like to do now it to host it in-process with IIS. But what I am struggling with is that I couldn't seem to find a clear and detailed instruction/document about what I need to do to get it to work. I have tried various configuration changes on my own but nothing works so far. I am running .Net Core 3.1 and using VS.Net 2019 on my Windows 10 environment. If someone could point me to the right direction it would be highly appreciated.
As far as I know, if you want to host the asp.net core application on the IIS. You should make sure you have installed the right hosting bundle.
Notice: No matter you use in-process or out-of-process, you all need install the IIS hosting bundle.
More details about how to install it, you could refer to this link.
After install the link, you could check your IIS module to make sure you have installed the right asp.net core module.
Then you could use VS to publish the application to right folder and create the IIS web site as below:
Create IIS website:

Running multiple ASP.NET Core 2.2 webapps side-by-side in IIS

I'm trying to run 2 ASP.NET Core 2.2 webapps side-by-side on IIS 10. I created CoreTestApp1 & CoreTestApp2 (default VS template, no added code), i.e. both set up for In-Process hosting.
After I restart my server (IIS Mgr), the first webapp that I open in a browser (e.g. CoreTestApp1) runs fine; if I open the second one (CoreTestApp2) I get an error "HTTP Error 500.0 - ANCM In-Process Handler Load Failure".
If I restart my server again and open CoreTestApp2 first, then that runs fine, but now CoreTestApp1 causes the same error.
I tried running 2 ASP.NET Framework apps side by side, and that works fine.
Judging by the info I found (e.g. https://learn.microsoft.com/en-us/dotnet/core/deploying/index), it seems I should be able to run multiple core apps side-by-side?
Is there some extra config stuff that I'm missing?
Not sure if this is relevant, but I used Visual Studio's publish (to folder) with these settings...
Configuration = Debug
Target Framework = netcoreapp2.2
Deployment mode = framework-dependent
Target runtime = portable
Thanks to Lex's suggestion and some more googling, I found the answer to my question here:
The ASP.NET Core module V2 running in InProcess mode has to run in its own dedicated Application Pool. According to the documentation you cannot run multiple sites or virtual directories (Web Applications) using the the ASP.NET Core Module in a single Application Pool. Make sure each ASP.NET Core app on IIS gets its own Application Pool.
Creating extra Application Pools and assigning each ASP.NET Core app its own solved my problem; instructions on how to create App Pools here.

Page keeps loading forever

Im using IIS 8.5 on Windows Server 2012 R2 so I add my Web Api but when I try to view the site it stays in a loading state like this:
Do not show any message or error just stays loading, I think that i miss some configuration or feature in my IIS but I don't know which one.
Edit: I use .Net framework, it is a REST .net web api like this reference, the IIS have installed .Net versions 3.5 and 4.5, it's IIS not the express and the default IIS website runs fine.
I would really appreciate any help.
Try to reduce the timeout settings to a minimum level, say 10 seconds.
See if it throws a Timeout error.
Without much information from your side its hard to judge.
Perhaps it could be an external service you are trying to access(Web service) or a DB connection?
Please check if the application pool you assigned to your solutions runs under the correct version of .net framework and in integrated mode. I had similar issues when trying to run an mvc app in classic mode. Check this out.
EDIT 1 - Reconfiguring IIS
If problems persists then try the ASP.NET IIS Registration tool. Execute the followig command as administrator:
aspnet_regiis -i
At the end of this post the different locations for aspnet_regiis are described. You should select a .NET Framework version corresponding to that of your project, run aspnet_regiis and assign the proper application pool to your app.

ServiceStack selfhosted performance on Raspberry

I have a C# console application with a self hosted ServiceStack server (based on AppSelfHostBase).
It has both REST API (get and post) and a "standard" html/javascript website.
If i run the code under Windows, it works great, but if i run using RaspberryPI, it is slow and never got a response.
Any ideas?
Thanks
Leonardo Zambonelli
If you're using ServiceStack on Mono on Raspberry PI I'd recommend converting your project to .NET Core which will provide an instant performance improvement.
All .NET Core Apps are Console Apps and you can checkout the ServiceStack .NET Core Apps for examples of ServiceStack Apps running on .NET Core.
Thanks mythz!
I'm not worried about performance at the moment, but the main problem is that is not working at all! I don't need high performance because it's just a Rest Service that is used by one user(app) at a time.
The application is quite big, and converting to .net seems to be quite hard (we use a lot of serial port communication, and other stuff that are not present in .net core)
Added: just a quick note. On a Virtual Linux machine it works fine, so the problem seems to be only on Mono on Raspberry. If someone has any suggestion ( a part converting the project) it would be useful.
Thanks
Leo

How can I deploy an Asp.Net MVC Core application, using .Net Framework (not core) in my local IIS?

Using Visual Studio 2017 the most obvious way to me is to publish to IIS using file system. When I host the folder that comes outof this publishing in IIS I use an App Pool with .Net 4.5.1 (I also use .Net 4.5.1 for my app). When I access the web page with the browser, static content works, but dynamic content returns HTTP 501 without further information.
In the events viewer I see no entries.
How can I diagnose this? Should I try another way to get the app running in the local IIS and later on an inhouse server using IIS?
As described here http://learn.microsoft.com/en-us/aspnet/core/publishing/iis "Set the .NET CLR version to No Managed Code." your IIS application pool shoudln't be running .Net and should be set to No Managed Code.

Resources