add razor runtime compilation for development environment
This commit is contained in:
@@ -15,8 +15,10 @@ namespace MongoIdentitySample.Mvc
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
private IWebHostEnvironment _env;
|
||||
public Startup(IWebHostEnvironment env)
|
||||
{
|
||||
_env = env;
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
@@ -44,6 +46,16 @@ namespace MongoIdentitySample.Mvc
|
||||
.AddSignInManager()
|
||||
.AddDefaultTokenProviders();
|
||||
|
||||
|
||||
var builder = services.AddRazorPages();
|
||||
|
||||
#if DEBUG
|
||||
if(_env.IsDevelopment())
|
||||
{
|
||||
builder.AddRazorRuntimeCompilation();
|
||||
}
|
||||
#endif
|
||||
|
||||
services.AddMvc();
|
||||
|
||||
services.AddApplicationInsightsTelemetry();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
@RenderBody()
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© 2016 - IdentitySample</p>
|
||||
<p>© 2020 - IdentitySample</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user