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

Allow disabling of copying resource assemblies from NuGet packages during publish #774

Closed
DamianEdwards opened this issue Feb 1, 2017 · 4 comments

Comments

@DamianEdwards
Copy link
Member

DamianEdwards commented Feb 1, 2017

Many NuGet packages (including those shipped by Microsoft) include localized resource satellite assemblies in the main package. This can greatly inflate the publish output size of a typical ASP.NET Core application (like https://github.com/aspnet/live.asp.net) for no benefit in the cases where localized resources from such packages aren't desired or needed.

In this case, the publish output size grows from 12 MB to 26 MB due to the resource assemblies.

It would be great to have an MSBUILD property that could be set in the application's project file to disable copying of satellite assemblies from NuGet references to the publish folder.

@DamianEdwards
Copy link
Member Author

DamianEdwards commented Feb 2, 2017

Potential workaround for now:

<Target Name="RemoveSatellitesFromPublish" AfterTargets="ComputeFilesToPublish">
  <ItemGroup>
    <ResolvedFileToPublish Remove="@(ReferenceSatellitePaths)" />
  </ItemGroup>
</Target>

@DamianEdwards
Copy link
Member Author

DamianEdwards commented Feb 2, 2017

Workaround doesn't seem to work as the host fails if any assemblies listed in the deps.json aren't present:

Error: assembly specified in the dependencies manifest was not found -- package: 'microsoft.data.edm', version: '5.6.4',
path: 'lib/portable-net45+wp8+win8+wpa/de/Microsoft.Data.Edm.resources.dll'

Seems we'd have to update the build target to trim them out of the deps.json file too.

@DamianEdwards
Copy link
Member Author

@kieranmo suggested having a property to set the desired language outputs (like ClickOnce), so that only resources for those languages would be included. I like that idea.
e.g.

<PropertyGroup>
  <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
</PropertyGroup>

@srivatsn srivatsn added this to the 1.1 milestone Feb 3, 2017
@dsplaisted dsplaisted modified the milestones: 2.0, 1.1 May 15, 2017
@livarcocc livarcocc modified the milestones: 2.0.0, 2.1.0 Jul 19, 2017
@dsplaisted dsplaisted self-assigned this Feb 21, 2018
dsplaisted added a commit to dsplaisted/sdk that referenced this issue Mar 13, 2018
dsplaisted added a commit to dsplaisted/sdk that referenced this issue Mar 13, 2018
@DamianEdwards
Copy link
Member Author

Yay!!!

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

4 participants