0
votes

I am learning asp.net core when executing in browser i am getting response header has kestrel instead of iisexpress. I wrote the following code in Startup.cs configure method to get the process name but i'm still getting dotnet i'm not able to get iisexpress.

app.Run(async (context) => {
  await context.Response.WriteAsync("Hello World!\n");
  await context.Response.WriteAsync(System.Diagnostics.Process.GetCurrentProcess().ProcessName);//dotnet             
});

In Program.cs I add .UseIIS()

public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 
  WebHost.CreateDefaultBuilder(args)
    .UseIIS()
    .UseStartup<Startup>();

Following is from .csproj file

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>CookieStore</RootNamespace>
</PropertyGroup>

Kindly help me to run the project both in InProcess and OutOfProcess.

2
"i'm not able to get iisexpress": But I get iisexpress when I run it with Visual Studio (ASP.NET Core 2.2). Is there a demo that reproduces?itminus

2 Answers

0
votes

If you run the application from the CLI using "dotnet run" it will run in kestrel by default, if you are using Visual Studio try running the application with the IIS Express from launch drop down.

0
votes

Finally today the issue got resolved, after I updated my Visual Studio 2017. Earlier I used VS2017 15.3 after the update to VS2017 15.9, the issue has been resolved.