netsdk1018 invalid nuget version string

Pramila Sadashivan's Avatar

Pramila Sadashivan

15 Aug, 2024 05:27 AM

The build fails with the below error when I try to create a new branch from our develop branch. However, when I try to build the same branch in Visual Studio, the build succeeds. screenshot attached for reference.

"C:\projects\investorist\Investorist.sln" (default target) (1) ->
"C:\projects\investorist\Tools\Investorist.LambdaDeployment\Investorist.LambdaDeployment.csproj" (default target) (97) ->
  C:\Program Files\dotnet\sdk\5.0.416\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.GenerateAssemblyInfo.targets(203,5): error NETSDK1018: Invalid NuGet version string: '1.53.0-INV-4599-migrate-classic-storage-to-ARM.1+30+Sha.cb4fc063f08a32d7df180920c9fdd8b37e4cc3bb'. [C:\projects\investorist\Tools\Investorist.LambdaDeployment\Investorist.LambdaDeployment.csproj]

  1. Support Staff 1 Posted by Owen McDonnell on 16 Aug, 2024 08:57 PM

    Owen McDonnell's Avatar

    Could you point to a build and share your configuration?

  2. 2 Posted by Pramila Sadashi... on 17 Aug, 2024 05:26 AM

    Pramila Sadashivan's Avatar

    Please find the build log file attached. Thank you.

  3. 3 Posted by Pramila Sadashi... on 17 Aug, 2024 09:06 AM

    Pramila Sadashivan's Avatar

    Please find the build link and configuration file too. https://ci.appveyor.com/project/investorist/investorist/builds/50409515

  4. Support Staff 4 Posted by Owen McDonnell on 18 Aug, 2024 05:48 AM

    Owen McDonnell's Avatar

    So when you try to build the project in VS you are passing the same GitVersion environment variable to your build command as in your CI config, i.e. /p:Version=$env:GitVersion_InformationalVersion?
    Because the output of that (1.53.0-INV-4599-migrate-classic-storage-to-ARM.1+30+Sha.cb4fc063f08a32d7df180920c9fdd8b37e4cc3bb) is not valid semver so the error is expected.

  5. 5 Posted by Pramila Sadashi... on 20 Aug, 2024 02:00 AM

    Pramila Sadashivan's Avatar

    Hi Owen,

    We are not passing the GitVersion env variable to the build command when building the project in VS. I now understood the problem. What solution you would suggest to make the build unique without getting this error?

    Thank you.

  6. Support Staff 6 Posted by Owen McDonnell on 20 Aug, 2024 09:07 PM

    Owen McDonnell's Avatar

    Maybe APPVEYOR_BUILD_ID? There are some other variables available available within the build you can look at here

  7. Owen McDonnell closed this discussion on 09 Sep, 2024 05:56 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac