Program.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.Runtime.Loader;
  7. using System.Threading.Tasks;
  8. using Microsoft.AspNetCore.Hosting;
  9. using Microsoft.Extensions.Configuration;
  10. using Microsoft.Extensions.Hosting;
  11. using Microsoft.Extensions.Logging;
  12. using NLog.Web;
  13. namespace OrderSystem.Web
  14. {
  15. public class Program
  16. {
  17. public static void Main(string[] args)
  18. {
  19. CreateHostBuilder(args).Build().Run();
  20. }
  21. public static IHostBuilder CreateHostBuilder(string[] args)
  22. {
  23. //AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + @"\OrderSystem.Resources.dll");
  24. return Host.CreateDefaultBuilder(args)
  25. .ConfigureWebHostDefaults(webBuilder =>
  26. {
  27. webBuilder.UseStartup<Startup>();
  28. }).UseDefaultServiceProvider(options =>
  29. {
  30. options.ValidateScopes = false;
  31. }).UseNLog();
  32. }
  33. }
  34. }