How to publish service on IIS using ASP.NET Boilerplate? - asp.net-core

As there is no documentation, Could you please provide steps to publish ASP.NET Boilerplate service on IIS Server

All the steps are same for Asp.Net Core which we have for a classical Asp.Net web application.
First, you need to install the .NET Core Hosting Bundle. Please find the steps below.
Navigate to the .NET All Downloads page.
Select the latest non-preview .NET Core runtime from the list (.NET
Core > Runtime > .NET Core Runtime x.y.z). Unless you intend to work
with preview software, avoid runtimes that have the word "preview" in
their link text.
On the .NET Core runtime download page under Windows, select the
Hosting Bundle Installer link to download the .NET Core Hosting
Bundle.
After all the above steps just follow the steps which you do for Asp.Net web application.

Related

Can ASP.NET CORE MVC be hosted in Xamarin App(Android)?

I have a ASP.NET CORE MVC (.NET CORE 3.1) application running well on Kestrel in Windows, Now I'm wondering if possible to migrate it to Android via Xamarin?
The purpose of this move is the lower cost of Android device.
And I noticed: Run ASP.NET Core 3.0 apps with MonoVM
but seems no details?
No, Not yet (Jan 2021).
Xamarin, NetFramework, Net5, NetCore3 all support NetStandard. AspNetCore is based on NetCore, not NetStandard. If AspNetCore was a NetStandard library, it would support it, but AspNetCore uses other libraries in NetCore which do not exist on Xamarin.
By the way, if you need just a simple web server running on android like Kestrel, you can use EmdedIO. Indeed it doesn't support MVC, MVP, and MVVM, so you can not run AspNetCore app on Xamarin:
https://github.com/unosquare/embedio

.NET Core Hosting Bundle

As far as I understood the Docs, the .NET Core Hosting Bundle installs the .NET Core Runtime, .NET Core Library and the ASP.NET Core Module.
It seems that there's a Bundle for every version of the .NET Core Runtime (2.0.6, 2.0.7, ...).
If I have a self contained deployment of my app, I still need the ASP.NET Core Module. However I don't see that the Module can be downloaded separately without the full bundle. Is there a place where I can download it ?
If not:
What's the point of having a self contained application, if I still need to install the whole .net core sdk/runtime bundle on my IIS Server?
There is no official download of the ASP.NET Core Module for IIS ("ANCM"), though it can be installed by calling the hosting bundle installer with OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0 as arguments (at least for 1.0-2.0 installs).
What's the point of having a self contained application, if I still
need to install the whole .net core sdk/runtime bundle on my IIS
Server?
Apart from the installer being able to install only ANCM, do not forget that IIS is not the only hosting option for ASP.NET Core Applications. People may still opt to host it on linux or as a Windows Service. Either being exposed to the public Internet (which is supported from 2.0+) or behind NGINX/Apache/…
It is also very useful to deploy preview, daily or custom builds of any component inside .NET Core / ASP.NET Core if needed.
Check the docs on this topic.
The ASP.NET Core Module is a fork of HttpPlatformHandler which was modified to work with ASP.NET Core's new system and was previously used to host ASP.NET Applications. related GitHub issue
IIS needs it in order to start up your ASP.NET Core application when the first request arrives and to route requests to the ASP.NET Core application.
With .NET Core (and hence ASP.NET Core), ASP.NET Core comes with its own http server (previously this was only possible with Http.sys aka WebListener self-hosting, i.e. commonly used for WCF services). It also redirects a couple of headers to the application, since IIS with ASP.NET Core only acts as reverse proxy.
In other words, ASP.NET Core is hosted outside the IIS process, and ASP.NET Core Module is there to communicate with it and starts the outside process if not already. This also means, that ASP.NET Core applications hosted in IIS are subject to IIS lifetime cycle (i.e. IIS may and will stop your applications when idle - This doesn't happen when you self-host your application or use something like nginx as reverse proxy).
With ASP.NET Core 2.1 preview1 it will also be possible to host ASP.NET Core application in the IIS process (w3wp.exe) for a improve request throughput. For more information on this, read ASP.NET Core 2.1.0-preview1: Improvements to IIS hosting

How to enable trace.axd in ASP.NET core?

Our app is based on ASP.NET Core 2.0. It works fine in development environment but we see an oauth error when published to production.
All the documentation on asp.net core seems to point to using ILoggingxxx interfaces. The examples I found typically call logging.AddConsole() method so that the log lines can be viewed in VIsual Studio debug window. I am wondering if the good old trace.axd is still available under asp.net core. If so, I would appreciate the steps to enable tracing. Regards.
trace.axd is exclusive to applications based on .NET Framework and ASP.NET 4.x. It is not available in ASP.NET Core applications at all.

Why publishing to IIS is change for ASP.net core ?

When I publish under Visual Studio 2015 CTP 5 then I don't have to do setting for application pool CLR version.
Now for ASP.net core application and as per documentation (http://docs.asp.net/en/latest/publishing/iis.html) we have to do setting for application pool clr to No managed code.
Why it is like that ?
ASP.NET Core applications no longer run inside IIS but run out-of-process and IIS acts only as a reverse proxy. This functionality is provided by the AspNetCoreModule which is a native IIS module. Since no managed code runs in the IIS process it is recommended to set application pool as "No managed code".
I wrote a detailed blog post describing how ASP.NET Core applications are running with IIS. You can find it here.
This is because ASP.NET Core runs as a plain old command line application outside of the IIS. Therefore, IIS is merely a pass-through to Kestrel, which is the ASP.NET Core web server which runs in it's own separate process. This platform is what provides the cross-platform capabilities of .NET Core.

MVC 4 web application on IIS

I am novice to MVC4. I was using .net framework 3.5 for my web-application and was hosted on IIS 7. Recently we have decided to move on MVC. We have converted our web-application to MVC and on ASP.NET development server it is working fine. Then we deployed it on IIS 7 but not working.
Do we need to install .NET Framework or something to that machine / sever?
YOu are missing ASP.NET MVC libriaries. You have two options:
Install ASP.NET MVC on your server
Deploy required binaries with your application (see more on Scott Hanselman blog)