Skip to content

System.ArgumentException: '(,4)' is not a valid version string #393

@suchoss

Description

@suchoss

Hello,

first of all - great work. I tried current version of dotnet tools and it looks it works (with most projects in our solution) on our big old project.

Used tools versions:

try-convert            0.7.216201      try-convert
upgrade-assistant      0.2.217201      upgrade-assistant

Problematic project:
https://github.com/HlidacStatu/HlidacStatu/blob/master/Web.Statu/Web.csproj

It can't go past step 3. [Failed] Clean up NuGet package references. It ends with following error:

[12:19:42 INF] Initializing upgrade step Clean up NuGet package references
[12:19:51 FTL] Unexpected exception analyzing package references for: D:\repos\gardohundo\HlidacStatu\Web.Statu\Web.csproj
System.ArgumentException: '(,4)' is not a valid version string. (Parameter 'value')
   at NuGet.Versioning.NuGetVersion.Parse(String value)
   at Microsoft.DotNet.UpgradeAssistant.Steps.Packages.Analyzers.TransitiveDependencyExtensions.ReferenceSatisfiesDependency(PackageDependency dependency, NuGetReference packageReference, Boolean minVersionMatchOnly) in /_/src/steps/Microsoft.DotNet.UpgradeAssistant.Steps.Packages/Analyzers/TransitiveDependencyExtensions.cs:line 32
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.DotNet.UpgradeAssistant.Steps.Packages.Analyzers.TransitiveReferenceAnalyzer.AnalyzeAsync(IProject project, PackageAnalysisState state, CancellationToken token) in /_/src/steps/Microsoft.DotNet.UpgradeAssistant.Steps.Packages/Analyzers/TransitiveReferenceAnalyzer.cs:line 31
   at Microsoft.DotNet.UpgradeAssistant.Steps.Packages.PackageUpdaterStep.RunPackageAnalyzersAsync(IUpgradeContext context, CancellationToken token) in /_/src/steps/Microsoft.DotNet.UpgradeAssistant.Steps.Packages/PackageUpdaterStep.cs:line 206
   at Microsoft.DotNet.UpgradeAssistant.Steps.Packages.PackageUpdaterStep.InitializeImplAsync(IUpgradeContext context, CancellationToken token) in /_/src/steps/Microsoft.DotNet.UpgradeAssistant.Steps.Packages/PackageUpdaterStep.cs:line 136

The problem is in https://github.com/HlidacStatu/HlidacStatu/blob/master/Web.Statu/packages.config

  <package id="bootstrap" version="3.4.1" targetFramework="net472" allowedVersions="(,4)" />
  <package id="bootstrap.less" version="3.4.1" targetFramework="net472" allowedVersions="(,4)" />

and another problem in the same file is with following:

<package id="Microsoft.AspNet.TelemetryCorrelation" version="1.0.7" targetFramework="net472" allowedVersions="[1.0.7]" />

Generally packages with allowedVersions attribute are causing fails when being converted.

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    TriagedLabel to show that UA team has triaged this issue.bugSomething isn't workingcommunity reportedhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions