8000 Publish output is different when specifying custom --output location · Issue #14274 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content

Publish output is different when specifying custom --output location #14274

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

Open
jasonkarns opened this issue Oct 21, 2020 · 3 comments
Open
Milestone

Comments

@jasonkarns
Copy link

We're using .net core 3.1 and efcore 3.1, including the efcore .Design package. During publish our output directory included lots of localization files that are unnecessary for us.

After some googling we came across these relevant threads:

https://stackoverflow.com/questions/48424796/net-core-build-produces-localization-folders
https://stackoverflow.com/questions/48893450/visual-studio-2017-localization-publish-settings
https://stackoverflow.com/questions/20342061/disable-dll-culture-folders-on-compile/60655083#60655083
#774

The approach that worked for us was adding <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>.

And for a time all was well, until we changed our publish command to emit to a custom --output location. That change (and only that change) caused the publish output to suddenly contain all those unnecessary localization directories again.

After a clean build:

dotnet publish --configuration Release -p:EnvironmentName=Staging --runtime win-x64 --no-self-contained
$ ls UpgApi/bin/Release/netcoreapp3.1/win-x64/publish | wc -l
      98
$ dust UpgApi/bin/Release/netcoreapp3.1/win-x64/publish
# total size 40M

Changing nothing but adding an explicit --output:

dotnet publish --configuration Release -p:EnvironmentName=Staging --runtime win-x64 --no-self-contained --output webapp
$ ls -l webapp | wc -l
     150
$ dust webapp
# total size 57M

I don't understand why changing the output location would cause the output to differ, but it makes me very nervous. I'd expect identical commands but with a custom output location to produce identical outputs.

@marcpopMSFT marcpopMSFT added the untriaged Request triage from a team member label Oct 23, 2020
@sfoslund sfoslund removed the untriaged Request triage from a team member label Oct 29, 2020
@sfoslund sfoslund added this to the Backlog milestone Oct 29, 2020
@sfoslund sfoslund removed their assignment Oct 29, 2020
@loudar
Copy link
loudar commented Jun 7, 2024

Also having this issue. We're seeing localization data from Microsoft.VisualStudio.TraceDataCollector.resources.dll in localization folders. We're using a custom output directory on solution level and have set the SatelliteResourceLanguages to de, even within the command (within a powershell script):

dotnet msbuild /t:Publish /p:Configuration=Release /p:PublishDir=../$outDir/$apiDir /p:SatelliteResourceLanguages=de

@deepakjgupta
Copy link

Hello, I see the same issue with "dotnet publish" for Test Projects. Some online posts suggest adding ExcludeAssets="All" to the "Microsoft.NET.Test.Sdk" ProjectReference. However, doing so also removes files such as "testhost.exe" which prevents me from running Automated Tests.

Any thoughts?

@kevin-osborne
Copy link

using a custom output folder and SatelliteResourceLanguages seems to work fine for me under dotnet9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
0