I have a dotnet core project and trying to build from command line using the dotnet publish -c "Release" -p:Version=x.x.x.x
command.
I also tested with the following variations of the parameter
- -p:Version=”x.x.x.x”
- /p:Version=x.x.x.x
- /p:Version=”x.x.x.x”
unfortunately none of them worked.
I also had an AssemblyInfo.cs file in the project. There is no ‘Version’ node in the .csproj file.
I tried to building with or without the AssemblyVersion attribute, also tried to build without the file, but the ‘File version’ and ‘Product version’ of the DLL still remained 0.0.0.0 or the defined value if one was specified in the AssemblyInfo.
How should I build the project to obtain a version number?
Mate Nagy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1