-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add a switch to control publishing files to the refs directory - PreserveCompilationReferences #2122
Comments
cc @eerhardt \ @livarcocc \ @DamianEdwards \ @rynowak We'd like to get this considered for 2.1.0 rc. Let me know if you'd like to set up an offline discussion for this. |
Any progress on this? For us we want to keep the publish package size small so we are always setting |
Guys, do we have any progress on this issue? |
See https://github.com/dotnet/cli/issues/10502#issuecomment-452408306 We should do this now. cc @dsplaisted |
This would be super nice to have built-in. We do our own workaround for this in Razor, and it would be better if we could just set a property default value 👍 |
Related issues - #2092, #2121
PreserveCompilationContext
is used in two places todaybin\refs
andpublish\refs
directories.Prior to 2.1.0, the Web Sdk always set
PreserveCompilationContext=true
. This resulted in increased deployment sizes even when the app did not require these files due to design time compilation of views. In 2.1.0-preview2, we tried conditionally setting this value in the WebSdk based on the presence of Razor files. This broke Mvc's runtime capabilities which relies on being able to inspect the deps file to query dependencies. There's more information about it here - #2092 (comment).What we care about, is the ability to suppress publishing the refs directory for most applications. In lieu of solving #2092, which seems like a much more involved issue, it would be easier if we could have a different switch (suggestion
PreserveCompilationReferences
) that is used to determine if the refs directory gets emitted. Here are the two places we'd use this switch in lieu ofPreserveCompilationContext
:sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PreserveCompilationContext.targets
Lines 45 to 46 in 6945e36
sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PreserveCompilationContext.targets
Lines 84 to 85 in 6945e36
The Web.Sdk \ Razor.Sdk would be responsible for setting the default value of this property as also initializing it if the user explicitly specified
PreserveCompilationContext
in their project files.The text was updated successfully, but these errors were encountered: