sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Version number is missing from dotnet publish output in linux docker images

Open npuc85 opened this issue 6 years ago • 7 comments

File Version and Product Version information are missing from .exe files that are created using dotnet publish -c Release -r win-x64 inside of a linux based docker image (mcr.microsoft.com/dotnet/core/sdk:3.1).

exe files created by dotnet build -c Release do contain File Version and Product Version information.

npuc85 avatar Aug 13 '20 21:08 npuc85

yes - can confirm that this is still the case with the net5 sdk in the image 'FROM mcr.microsoft.com/dotnet/runtime-deps:5.0'. The version is set for the dll on normal publish, but not for the exe when you use /p:PublishSingleFile=true Publishing on windows works fine, the version is set there in the exe as well.

clane2812 avatar Jul 21 '21 05:07 clane2812

This topic is discussed and yet open https://github.com/dotnet/sdk/issues/4127 (duplicate) https://github.com/dotnet/runtime/issues/3828 (main-topic)

clane2812 avatar Jul 21 '21 11:07 clane2812

Any updates on this?

PallaviThanvi avatar Dec 07 '21 21:12 PallaviThanvi

Also experiencing this issue on Ubuntu based Azure Pipeline agents when targeting dotnet core builds for win-x64

CodyPaul avatar Dec 16 '21 20:12 CodyPaul

any updates on this? I'm trying to build dotnet 6 apps and still having this same problem... the file version is not being set, and neither are other attributes

eric10k93 avatar May 24 '23 19:05 eric10k93

I also have this issue!

I used the following command to build my project:

dotnet publish -c Release -r ${{ matrix.platform }} --self-contained -o ${{ matrix.folder_name }} -p:SkipSwaggerGen=true -p:EnableCompressionInSingleFile=true -p:FileVersion=version -p:Version=version -p:AssemblyFileVersion=version

GOATS2K avatar Jun 07 '23 14:06 GOATS2K

Just an update on this, in case it's helpful to anyone. I realized that for a .exe file build, dotnet ALSO produces a .dll file. I WAS building with SingleFilePublish=true, but setting this to false allows me to see the .dll file that dotnet produces. The FileVersionInfo is then contained within the .dll file, just not the .exe

eric10k93 avatar Jun 07 '23 17:06 eric10k93