Skip to content
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

Closed
pranavkm opened this issue Apr 9, 2018 · 5 comments
Assignees
Milestone

Comments

@pranavkm
Copy link
Contributor

pranavkm commented Apr 9, 2018

Related issues - #2092, #2121

PreserveCompilationContext is used in two places today

  1. To determine if compilation content goes in the deps file
  2. If reference assemblies need to be copied to the bin\refs and publish\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 of PreserveCompilationContext:

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.

@pranavkm
Copy link
Contributor Author

pranavkm commented Apr 9, 2018

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.

@normj
Copy link
Contributor

normj commented Sep 16, 2018

Any progress on this? For us we want to keep the publish package size small so we are always setting PreserveCompilationContext to false but this breaks some customer scenarios.

@lmolotii
Copy link

Guys, do we have any progress on this issue?

@nguerrera nguerrera modified the milestones: 2.2.1xx, 3.0.1xx Jan 8, 2019
@nguerrera
Copy link
Contributor

@rynowak
Copy link
Member

rynowak commented Jan 8, 2019

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants