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

shijiyong's Avatar


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">


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


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


    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

    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

    Best regards,

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

  3. PostSharp Technologies re-opened this discussion on 23 Apr, 2018 03:25 PM

  4. Support Staff 2 Posted by PostSharp Techn... on 23 Apr, 2018 03:25 PM

    PostSharp Technologies's Avatar


    the bug #15945 has been fixed in the current preview release of PostSharp 5.1.9.
    Should you need further help with this issue, don't hesitate to re-open this discussion.

    Best regards,

  5. PostSharp Technologies closed this discussion on 23 Apr, 2018 03:25 PM.

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

Keyboard shortcuts


? 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