dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.96k stars 4.03k forks source link

Confusing error message about determinism and AssemblyVersion in VB #30738

Closed vsfeedback closed 2 months ago

vsfeedback commented 5 years ago

Recently updated to Visual Studio 2017 v 15.8.5

Changing AssemblyInfo.vb from default (swapping comments):

' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

to:

<Assembly: AssemblyVersion("1.0.*")>
'<Assembly: AssemblyVersion("1.0.0.0")>
'<Assembly: AssemblyFileVersion("1.0.0.0")>

gives the following error:

Error BC36962 The specified version string does not conform to the required format - major[.minor[.build|[.revision|]]]

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/346841/bc36962.html VSTS ticketId: 694617 These are the original issue comments: (no comments) These are the original issue solutions: (no solutions)

agocke commented 5 years ago

We fixed this for C# here: https://github.com/dotnet/roslyn/issues/22660 (PR https://github.com/dotnet/roslyn/pull/22973) but forgot about VB.

A9G-Data-Droid commented 5 years ago

Just got this error today on a new project. This ticket has been open for a long time. It was fixed in October?

chewiiieee commented 5 years ago

Did this ever get fixed in VB??? Seems to be still happening in VS 16.2.1.

chewiiieee commented 5 years ago

Nevermind. For anyone who read this the fix is to add the following to your *.vbproj file.

  <PropertyGroup>
    <Deterministic>False</Deterministic>
  </PropertyGroup>
PeterAdam commented 1 year ago

Still unfixed. Please.

adamint commented 6 months ago

@jaredpar @sharwell we've received two feedback tickets in the past month about this issue

BitBucket3 commented 2 months ago

When, if EVER, is this going to be fixed? It is VERY frustrating to have to remember to manually change the build number every time and has lead to several incorrect versions being used.

agocke commented 2 months ago

I no longer work on the compiler, but if someone wants to try fixing this themselves, porting https://github.com/dotnet/roslyn/pull/22973 over to VB should be simple. The symbol model for VB is a mirror of the C# one. It would basically be taking the changes to the C# SourceAssemblySymbol and making the same changes to the VB source assembly symbol.

I think this would be a good fix for someone who's never contributed to Roslyn before.