Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net core build produces localization folders

I have a web asp.net solution that is using .net core 2.0. I am building it using the command:

dotnet publish MySolution.sln --configuration release --output d:\test_output 

But when I check the output folder, I'm seeing a lot of localization folders, as you can see in the image bellow:

output content

Is there a way to publish the code without generating these folders?

like image 776
Buda Gavril Avatar asked Jan 24 '18 14:01

Buda Gavril


2 Answers

For the projects using ASP.NET Core 3.1, add this line to your *.csproj file:

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

The source of the answer in this post: Disable Dll Culture Folders on Compile.

like image 92
Igor.K Avatar answered Oct 04 '22 06:10

Igor.K


The solution provided by @Igor.K worked for my API project, but for the ASP.NET Core MVC website in my solution, I had to make a minor change.

Try adding the line below to your .csproj file.

<PropertyGroup>        <ResourceLanguages>en</ResourceLanguages> </PropertyGroup> 

You can edit this file by right-clicking your project and selecting "Unload Project". Then, when you right-click again you will be able to edit the .csproj file. Make sure you reload the project when you're finished though.

So, if SatelliteResourceLanguages doesn't solve your problem, ResourceLanguages might do the trick.

like image 22
Scott Ridings Avatar answered Oct 04 '22 05:10

Scott Ridings