Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

OptimizationLevel specified in the dependency context \ primary assembly's project.json is never used when compiling views #4902

@pranavkm

Description

@pranavkm

DependencyContextViewEngineOptionsSetup and RazorViewEngineOptionsSetup modify compilation options - the first based on what's specified in the dependency context and second based on IHostingEnviornment.EnvironmentName. However the former setup's option values are always overwritten by RazorViewEngineOptionsSetup which runs second.

Additionally, the value set in OptimizationLevel determined in DependencyContextViewEngineOptionsSetup is incorrect - https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DependencyContextRazorViewEngineOptionsSetup.cs#L60-L62 needs to be inverted so that when your project.json says optimize, we choose Release.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions