Skip to content
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

AssemblyInformationalVersionAttribute fails on SemVer2 strings #35793

Open
rainersigwald opened this issue May 17, 2019 · 9 comments
Open

AssemblyInformationalVersionAttribute fails on SemVer2 strings #35793

rainersigwald opened this issue May 17, 2019 · 9 comments

Comments

@rainersigwald
Copy link
Member

Version Used: 3.100.19.22309 (ce8ac3f7)

Steps to Reproduce:

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.2.3-p.4.5+metadata")]

namespace Version
{
    class Program
    {
        static void Main(string[] args)
        { }
    }
}
PS C:\src\manualversion> csc Version.cs ; [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\src\manualversion\version.exe") | fl                                                                                                                                   Microsoft (R) Visual C# Compiler version 3.100.19.22309 (ce8ac3f7)                                                                   Copyright (C) Microsoft Corporation. All rights reserved.


OriginalFilename  : ?
FileDescription   :
ProductName       :
Comments          :
CompanyName       :
FileName          : C:\src\manualversion\version.exe
FileVersion       : 0.0.0.0
ProductVersion    : 1.2.3-p.4.5+metadata
IsDebug           : False
IsPatched         : False
IsPreRelease      : False
IsPrivateBuild    : False
IsSpecialBuild    : False
Language          : Language Neutral
LegalCopyright    :
LegalTrademarks   :
PrivateBuild      :
SpecialBuild      :
FileVersionRaw    : 0.0.0.0
ProductVersionRaw : 0.0.0.0

Expected Behavior:

ProductVersionRaw : 1.2.3.0

This appears to be what you get if you have too many dots in the pre-release version section (after the dash). For instance, this works:

[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.2.3-p-4.5+metadata")]

but this does not:

[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.2.3-p-4.5.6+metadata")]

Actual Behavior:

ProductVersionRaw : 0.0.0.0

This manifests more importantly as a failure in

(Get-Command ./version.exe).Version

Which is how it was reported to MSBuild after the first Arcade + semver2 MSBuild builds rolled out into internal VS channels.

@tmat
Copy link
Member

tmat commented May 17, 2019

The issue might be in WriteVSFixedFileInfo

@nguerrera
Copy link
Contributor

Is this a regression or is that always how informational version in this form was handled? Do we need to be concerned about a breaking change here?

@tmat
Copy link
Member

tmat commented May 17, 2019

This is how csc always worked. It didn't account for SemVer2. But there is no spec for parsing AIV, so we do best effort. We just looked at it with @jcouv and we think we can fix the compiler.

@jcouv
Copy link
Member

jcouv commented May 20, 2019

@tmat What is the urgency of this issue at this point? I assume that your arcade mitigation went in already.
Adding @jaredpar since I'm out this week and he wanted to discuss this (may be a feature rather than a bug, which may affect if/how we want to address this).

@tmat
Copy link
Member

tmat commented May 20, 2019

Not urgent. I don't see how this is more than a trivial to fix bug though.

rainersigwald added a commit to rainersigwald/msbuild that referenced this issue May 20, 2019
Works around dotnet/roslyn#35793 which sets a
win32 resource to a bad value when there are too many dots in
`AssemblyInformationalVersion`.

Medium term, I'd rather see us on semver2, since it's a nicer overall
experience.
rainersigwald added a commit to dotnet/msbuild that referenced this issue May 21, 2019
Works around dotnet/roslyn#35793 which sets a
win32 resource to a bad value when there are too many dots in
`AssemblyInformationalVersion`.
@DustinCampbell
Copy link
Member

FWIW, this is causing me a ton of pain because I can't build from VS command prompt. Is there a fix in sight?

@nguerrera
Copy link
Contributor

@DustinCampbell It should be a matter of having an arcade with this change: dotnet/arcade#2825

Is that not already the case?

@tmat
Copy link
Member

tmat commented May 22, 2019

@DustinCampbell Should be merged to Roslyn repo now. What repo are you working with?

@DustinCampbell
Copy link
Member

DustinCampbell commented May 23, 2019

https://github.com/dotnet/winforms-designer. Maybe we just took the update? Will try again this morning.

Update: This does work today.

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

No branches or pull requests

6 participants