0

I'm looking to switch this local environment to use Windows Authentication in order to facilitate the usage of the following logic inside of the code.

User.IsInRole("BRV_Projects_Edit");

I'm launching dotnet core locally in a windows environment using the command

"dotnet run"

My understanding is this will launch the Main() entry point

public class Program
{
    public static void Main(string[] args)
    {
        CreateWebHostBuilder(args).Build().Run();
    }

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

Does the UseIIS() indicate that this will launch IISExpress locally? Does this mean I should be able to locate a web.config to change the authentication scheme?

ffejrekaburb
  • 656
  • 1
  • 10
  • 35

1 Answers1

1

In short, no. The dotnet CLI cannot launch IIS Express as it is not cross platform (see this answer on the Visual Studio Developer Community site. If you use dotnet run then it will host the app in Kestrel

The UseIIS(), UseIISIntegration() and UseKestrel() calls enable your app to be hosted in the different environments but do nothing to actually launch those hosts.

The actual host used is defined in the launchsettings.json file which should be part of your web application (under Properties in the Visual Studio Solution Explorer).

Also, you do not need to add UseIIS() yourself as it is done for you as part of the WebHost.CreateDefaultBuilder() call. You can read more about what CreateDefaultBuilder() does here

There is another question and answer that will help you launch IIS Express from the command line for dotnet apps.

If you want to host the app in IIS then the instructions are here

Simply Ged
  • 8,250
  • 11
  • 32
  • 40
  • Thank you for the link. Your cross platform statement clarified my perspective. By using Visual Studio 2017 as apposed to Visual Studio Code I am able to easily launch iisexpress. – ffejrekaburb Jan 30 '19 at 21:58