Version number is missing from dotnet publish output in linux docker images
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.
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.
This topic is discussed and yet open https://github.com/dotnet/sdk/issues/4127 (duplicate) https://github.com/dotnet/runtime/issues/3828 (main-topic)
Any updates on this?
Also experiencing this issue on Ubuntu based Azure Pipeline agents when targeting dotnet core builds for win-x64
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
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
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