Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 12765737

@User 12765737
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to Add Add Microsoft Extensions Hosting Manually in .Net Project
    U User 12765737

    I am migrating the .Net Project to .Net core 3.1 and there are loads of dependencies in the project so I cannot create a new .Net core application. How can I add Program.Cs file in my existing .Net api project?

    I need this code in my existing .Net api project

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

        public static IHostBuilder CreateHostBuilder(string\[\] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup();
                })
                .UseSerilog((hostingContext, loggerConfiguration) =>
                {
                    var connectionString = hostingContext.Configuration.GetSection("Serilog:WriteTo:0:Args:connectionString");
                    connectionString.Value = connectionString.Value;
                    loggerConfiguration.ReadFrom.Configuration(hostingContext.Configuration);
                });
    }
    
    ASP.NET question csharp asp-net dotnet hosting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups