netsdk1018 invalid nuget version string

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. Could you point to a build and share your configuration?

  2. Please find the build log file attached. Thank you.

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

  4. 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. 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. 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

Recent Discussions