Luc Millette Luc Millette - 1 year ago 203
C# Question

Invalid value for 'AssemblyVersion' when building valid csproj

I have a project which references a few other projects. They are all built using x86 as the platform. This compiles just fine on my desktop.

During my remote VSO build I am always getting the error

MSB3174: Invalid value for 'AssemblyVersion'

When I edit the
file, I see nothing wrong with it. What am I doing wrong?

VSO build arguments are simply:
/t:Publish /p:ApplicationVersion=$(Build.BuildNumber)

I have other projects that use $(Build.BuildNumber) with no problems

Arguments as seen on VSO build log (snipped for clarity):

"C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "[App_PATH].csproj"
/dl:CentralLogger,[*snip dll path]

EDIT: I tried running the MSBuild from a local command prompt and I get the same behavior. VSTS or any of its setup info is not to blame.

I just wish I knew were to look in my app to correct it.

Answer Source

The issue is here:


The version format does not meet the requirement. Please try with this format:

Refer to MSBuild Error MSB3174 and Version Constructor (String) for details.


The version parameter can contain only the components major, minor, build, and revision, in that order, and all separated by periods. There must be at least two components, and at most four. The first two components are assumed to be major and minor. The value of unspecified components is undefined. The format of the version number is as follows. Optional components are shown in square brackets ('[' and ']'): major.minor[.build[.revision]] All defined components must be integers greater than or equal to 0. For example, if the major number is 6, the minor number is 2, the build number is 1, and the revision number is 3, then version should be "".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download