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

Microsoft.CodeAnalysis.CSharp puts a lot of resource litters in the output folder #39458

Closed
Nefcanto opened this issue Oct 23, 2019 · 8 comments
Labels
Area-Compilers Need More Info The issue needs more information to proceed.

Comments

@Nefcanto
Copy link

I don't use CodeAnalysis at all. But I don't know why, my output folder contains a lot of folders related to cultural resources of Microsoft.CodeAnalysis.CSharp.

I've asked it first here.

Can you create a clean output folder when there is no need for localization resources?

@gafter
Copy link
Member

gafter commented Oct 24, 2019

@Nefcanto Please provide a complete project that demonstrates the issue that concerns you, and identify what specific output folder you are talking about and which files you are referring to.

@gafter gafter added the Need More Info The issue needs more information to proceed. label Oct 24, 2019
@Nefcanto
Copy link
Author

After upgrading to .NET Core 3.0, based on this issue I had to replace RazorViewEngineOptions with MvcRazorRuntimeCompilationOptions which is located inside Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package. This package results in this bin folder:

67266404-0e742600-f4bd-11e9-8a8c-3b59039bf5a2 1

And when I look inside each of these folders, I see this:

image

Is this information enough?

@vankampenp
Copy link

vankampenp commented Oct 27, 2019

I had the same issue. Same folders but content is
Microsoft.CodeAnalysis.CSharp.resources.dll
Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
Microsoft.CodeAnalysis.resources.dll
Microsoft.CodeAnalysis.Workspaces.resources.dll

After removing
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />

From the project file it was resolved. I got that reference when scaffolding an addition to my project.

@jmarolf
Copy link
Contributor

jmarolf commented Oct 28, 2019

@Nefcanto and @vankampenp

if you are using the new sdk-style project format you can add this property to your project

<SatelliteResourceLanguages>en</SatelliteResourceLanguages>

this should ensure that these resource dlls are not deployed

@Nefcanto
Copy link
Author

@jmarolf, that solved my problem. Thank you so much.

@jmarolf
Copy link
Contributor

jmarolf commented Oct 28, 2019

@Nefcanto I am going to close this issue in that case. Things are working as designed

@jmarolf jmarolf closed this as completed Oct 28, 2019
CodeFuller added a commit to CodeFuller/movie-library that referenced this issue Jan 18, 2021
Because of the package Microsoft.VisualStudio.Web.CodeGeneration.Design, dozen locale directories are deployed with the application.
Each directory contains the following files:

Microsoft.CodeAnalysis.CSharp.resources.dll
Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
Microsoft.CodeAnalysis.resources.dll
Microsoft.CodeAnalysis.Workspaces.resources.dll

Removing of this package is recommended as workaround - dotnet/roslyn#39458
@svrooij
Copy link

svrooij commented Jan 12, 2024

@Nefcanto and @vankampenp

if you are using the new sdk-style project format you can add this property to your project

<SatelliteResourceLanguages>en</SatelliteResourceLanguages>

this should ensure that these resource dlls are not deployed

@jmarolf Why for heavens sake it this still an "issue" 4 years later. Who ever wants all those crazy resource files for an analyzer, that shouldn't even be deployed anywhere. Analyzers are run at build time right, there is absolutely no need to deploy these files ever. I added a package to my solution, and they just appeared.

@bugproof
Copy link

bugproof commented Jul 12, 2024

Every single time I deal with this. I don't even have Microsoft.VisualStudio.Web.CodeGeneration.Design anywhere in my projects. There should be more detailed instructions how to find the culprit package that causes this.

I just added Directory.Build.props next to my .sln file with this content:

<Project>
   <PropertyGroup>
      <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
   </PropertyGroup>
</Project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Need More Info The issue needs more information to proceed.
Projects
None yet
Development

No branches or pull requests

7 participants