PostSharp build error with PackageReference version format in d.d.d.d (>5.1.4)

shijiyong's Avatar

shijiyong

19 Mar, 2018 06:33 AM

when i upgrade PostSharp to 5.1.4 or higher version, msbuild error when postsharp compile assembly for PackageVersion.TryParse reason.
I create an empty netstandard2.0 project with PostSharp 5.1.6 version, then i test all nuget packages which team may used.
with these tests, i guess PostSharp new version may not support version format in: [d.d.d.d]

error csproj content:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="PostSharp" Version="5.1.6-alpha" />
    <PackageReference Include="Consul" Version="0.7.2.3" />
  </ItemGroup>

</Project>

build error info:
  Restore completed in 72.19 ms for \\?.csproj.
POSTSHARP : error : error: Unhandled exception (postsharp-netstandard20.dll release | .NET Core 2.0.6): version See below for details. [\\?.csproj]
POSTSHARP : error : System.ArgumentException: version [\\?.csproj]
POSTSHARP : error : at PostSharp.Sdk.CodeModel.Binding.PackageVersion..ctor(Version version, String suffix) [\\?.csproj]
POSTSHARP : error : at PostSharp.Sdk.CodeModel.Binding.PackageVersion.TryParse(String input, PackageVersion& result) [\\?.csproj]
POSTSHARP : error : at PostSharp.Sdk.CodeModel.Binding.PackageProjectReference.^zfH7YSbV(PlatformInfoFactory _0, String _1, PlatformInfo _2) [\\?.csproj]
POSTSHARP : error : at ^rU5MGTYD9kxo.^bhV8(String _0) [\\?.csproj]
POSTSHARP : error : at PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectConfiguration[] _0, ProjectInvocationParameters _1) [\\?.csproj]
POSTSHARP : error : at PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectInvocationParameters _0) [\\?.csproj]
POSTSHARP : error : at PostSharp.Sdk.Extensibility.Project.LoadProject(ProjectInvocationParameters projectInvocationParameters, Domain& domain) [\\?.csproj]
POSTSHARP : error : at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) [\\?.csproj]

  1. Support Staff 1 Posted by PostSharp Techn... on 19 Mar, 2018 10:39 AM

    PostSharp Technologies's Avatar

    Hello,

    the reason of this error is that the package Consul uses a package version number which doesn't meet the NuGet package versioning documentation. See https://docs.microsoft.com/en-us/nuget/reference/package-versioning.

    However, since the NuGet package repository obviously allows such packages to be uploaded, we are going to change our handling of NuGet package versions to avoid this kind of errors.

    We're closing the ticket for now as the bug has been internally filed as issue #15945. We will contact you as soon as the bug fix has been released.

    For more details on our support policies and prioritization of bug fixes, please visit https://www.postsharp.net/support/policies.

    Best regards,
    -tony

  2. PostSharp Technologies closed this discussion on 19 Mar, 2018 10:39 AM.

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