2

I am developing Ap.Net Code web application, I am using the below setting in the csproj file. When I run the application using visual studio I can see dotnet.exe running in the task manager, but it should be w3wp.exe or iisexpress.exe in case of InProcess hosting. So what could be the reason behind it?

<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>

CSProj file:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
  </ItemGroup>
</Project>
Vivek Nuna
  • 25,472
  • 25
  • 109
  • 197
  • 1
    Why should it be w3wp or iisexpress? Neither of those are cross-platform, which .NET Core is. – fredrik Sep 20 '19 at 11:00
  • As I know when kestrel comes in to the picture only if it is OutOfProcess – Vivek Nuna Sep 20 '19 at 11:03
  • 2
    You should probably read [this](https://stackoverflow.com/questions/35639205/what-is-kestrel-vs-iis-express) QnA. – fredrik Sep 20 '19 at 11:04
  • 4
    You can choose whether your application should use IIS or Kestrel as its webserver in your Program.cs. Add the line `webBuilder.UseIIS()` in the `CreateWebHost` method to use IIS. But the runtime will always be `dotnet.exe` as you are writing code for the .NET Core – MindSwipe Sep 20 '19 at 11:04
  • 1
    And probably [this](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/?view=aspnetcore-2.2&tabs=windows) and [this](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-2.2) Microsoft documentation page – fredrik Sep 20 '19 at 11:05
  • I have gone through this link. according to this it should be w3wp or iisexpress. Please clarify if I am wrong. https://csharp-video-tutorials.blogspot.com/2019/01/aspnet-core-in-process-hosting.html – Vivek Nuna Sep 20 '19 at 11:08
  • Did you call `UseIIS()` or `CreateDefaultBuilder()`? Check that your project aligns with the [official documentation](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-2.2). – fredrik Sep 20 '19 at 11:14
  • @all If you watch this video, it's printing the Process name as iisexpress. But I am getting dotnet instead of this. https://www.youtube.com/watch?v=ydR2jd3ZaEA – Vivek Nuna Sep 20 '19 at 11:23
  • Even if IIS is hosting, it will be hosting something like "dotent YourApplication.dll", when using dotnet core. – Fildor Sep 20 '19 at 11:24
  • Share us your full csproj content. Do you develop with asp.net core 2.2? I made a test with default asp.net core mvc template, it works correctly to return `iisexpress` when I start from VS. – Edward Sep 23 '19 at 02:50
  • @TaoZhou updated the question with csproj file, the target framework is .net core 2.0 – Vivek Nuna Sep 23 '19 at 06:59
  • 1
    @viveknuna .NET Core 2.0 was a short-term release that went out of support after a few months. The long-term support version is 2.1. You definitely need to upgrade, either to 2.1 or 2.2, the latest short-term version, which also provides in-process hosting in IIS – Panagiotis Kanavos Sep 23 '19 at 08:31

1 Answers1

3

For hosting in process feature, it is in netcoreapp2.2.

For previous feature, it is out-of-process hosting.

This could be found from IIS in-process hosting

For testing this feature, you could try to create Asp.Net Core MVC 2.2 template.

If you want to check this feature in your current project, you need to migrate your current project to Asp.Net Core 2.2, for migration, you could refer Migrate from ASP.NET Core 2.1 to 2.2

Edward
  • 28,296
  • 11
  • 76
  • 121