-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Razor SDK shouldn't generate the MVC recompilation attributes unless its necessary #8161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
/cc @pranavkm |
Closing this based on the work happening in the linked issue, where we will introduce a dedicated flag on the project level, which will indicate whether those attributes should be generated or not. |
That doesn't address this issue. |
This is needed in preview4 (at least with the current state of things).The WebSDK specifies |
* Do not generate MVC attributes unless necessary Fixes dotnet/aspnetcore#8161
Fixes #8161 \n\nCommit migrated from dotnet/razor@a976b80
Fixes dotnet/aspnetcore#8161 \n\nCommit migrated from dotnet/razor@a976b80 Commit migrated from dotnet/aspnetcore@37275e5fd58c
Describe the bug
A web SDK project that targets
netcoreapp3.0
with no razor files will unconditionally have these attributes:This adds extra runtime references to types that are probably not used.
This logic needs to be updated to consider whether you have any
.cshtml
files, and/or be based on some explicit gesture in the project file, or just obsoleted.Basing this on the presence of
.cshtml
files could cause issues in the case will cause issues in the following cases:It's also an impactful change, because it requires evaluating an item group to evaluate a property, which means that it has to be in a target.
The
RelatedAssemblyPartAttibute
is purely for discovery of compiled views/pages and should be made conditional without reservation.The
Razor.Hosting
attributes are for the settings used by runtime compilation. We could consider obsoleting these now that runtime compilation is outside the shared framework. However - we need to consider the impact on downlevel. If this logic is inside theRazor.Design
package in 2.1/2.2 we can remove it from the SDK and say that it's not needed/supported in 3.0.The text was updated successfully, but these errors were encountered: