Created
May 26, 2022 16:49
-
-
Save talkingdotnet/9dba6c097b769002b99053bd5cd6c70e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | |
{ | |
loggerFactory.AddConsole(Configuration.GetSection("Logging")); | |
loggerFactory.AddDebug(); | |
app.UseApplicationInsightsRequestTelemetry(); | |
if (env.IsDevelopment()) | |
{ | |
app.UseBrowserLink(); | |
app.UseDeveloperExceptionPage(); | |
} | |
else | |
{ | |
app.UseExceptionHandler("/Home/Error"); | |
// For more details on creating database during deployment see http://go.microsoft.com/fwlink/?LinkID=615859 | |
try | |
{ | |
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>() | |
.CreateScope()) | |
{ | |
serviceScope.ServiceProvider.GetService<ApplicationDbContext>() | |
.Database.Migrate(); | |
} | |
} | |
catch { } | |
} | |
app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear()); | |
app.UseStaticFiles(); | |
app.UseIdentity(); | |
// To configure external authentication please see http://go.microsoft.com/fwlink/?LinkID=532715 | |
app.UseMvc(routes => | |
{ | |
routes.MapRoute( | |
name: "default", | |
template: "{controller=Home}/{action=Index}/{id?}"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment