This should be simple, but I haven't found a way to make this stop happening. Visual Studio publishes a lot of localized DLLs - It appears there is German localization, Spanish localization, Italian localization, french localization, Japanese localization, Russian localization and Korean localization. I have an ASP.NET Web API ODATA application, and when I publish the project using Visual Studio 2017, I have these localized dll's taking up unnecessary space in the bin folder. My application only needs to support En-US. How can I make this change? Screenshot of published bin folder:
16
votes
3 Answers
10
votes
Here is what worked for me:
- Open your csproj file with your favorite editor
- Under the heading
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">add the line:
<ExcludeFoldersFromDeployment>bin\ar;bin\cs;bin\de;bin\es;bin\fr;bin\he;bin\hi;bin\it;bin\ja;bin\ko;bin\nl;bin\pl;bin\pt;bin\ru;bin\tr-TR;bin\zh-Hans;bin\zh-Hant</ExcludeFoldersFromDeployment>
- Republish your solution
0
votes
I faced the same problem for my .NET core 2.0 web API. It appeared when I moved the solution from a machine to another where a new version of .NET Core was installed: .NET Core 2.1 ; That's why, on publishing all files of .NET core 2.0 where generated. To resolve this issue, I decided to migrate to version 2.1 which solved the issue and the published files were generated smoothly :)
