Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Localization Publish Settings

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:

enter image description here

like image 216
Jordan Avatar asked Feb 20 '18 20:02

Jordan


People also ask

How do I change publish settings in Visual Studio?

On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish. If you have previously configured any publishing profiles, the Publish pane appears. Click New or Create new profile.

How do I publish a Web application in Visual Studio 2017?

Get started. In Solution Explorer, right-click your project and choose Publish. If you're publishing this web app for the first time, next you see the Publish wizard. Visual Studio filters the list of destinations depending on the type of web app.


1 Answers

Here is what worked for me:

  1. Open your csproj file with your favorite editor
  2. 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>

  1. Republish your solution
like image 176
Jordan Avatar answered Nov 15 '22 23:11

Jordan