Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Main(string[] args)
- {
- var config = new ConfigurationBuilder()
- .AddJsonFile("hosting.json", optional: true)
- .AddCommandLine(args)
- .Build();
- var host = new WebHostBuilder()
- .UseKestrel()
- .UseContentRoot(Directory.GetCurrentDirectory())
- .UseIISIntegration()
- .UseStartup<Startup>()
- .UseConfiguration(config)
- .Build();
- host.Run();
- }
- public static void Main(string[] args)
- {
- BuildWebHost(args).Run();
- }
- public static IWebHost BuildWebHost(string[] args)
- {
- return WebHost.CreateDefaultBuilder(args)
- .ConfigureLogging((context, logging) =>
- {
- logging.AddSerilog();
- })
- .UseStartup<Startup>()
- .Build();
- }
- {
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:5005/",
- "sslPort": 0
- }
- },
- "profiles": {
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": true,
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
- "Robert.Project.Web": {
- "commandName": "Project",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- },
- "applicationUrl": "http://localhost:5006"
- }
- }
- }
- public static IWebHost BuildWebHost(string[] args)
- {
- var config = new ConfigurationBuilder().AddCommandLine(args).Build();
- return WebHost.CreateDefaultBuilder(args)
- .UseConfiguration(config)
- .UseStartup<Startup>()
- .Build();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement