Cannot compile a .NET Standard 2.0 project with 6.0.10-preview

avatar's Avatar

avatar

25 May, 2018 04:11 PM

Attempting to compile a .NET Standard project fails with the following error:

0>Executing "dotnet" C:\Users\avatar\.nuget\packages\postsharp\6.0.10-preview\build\bin.Release\tools\netcoreapp2.0\PostSharp.Compiler.Hosting.CommandLine.dll obj\Debug\netstandard2.0\Before-PostSharp\StandardFail.dll C:\Working\Repro\StandardFail\obj\Debug\netstandard2.0\PostSharp\postsharp.config /config C:\Users\avatar\.nuget\packages\postsharp\6.0.10-preview\build\bin.Release\tools\netcoreapp2.0\PostSharp.Compiler.Hosting.CommandLine.dll.config /NoLogo /InstallVsx /cancel:Local\postsharp-cancel-c8a5bc3f-6cfc-4af1-8707-ecda557f42f3
0>POSTSHARP(0,0): Error: error: Unhandled exception (PostSharp.Compiler.Hosting.CommandLine.dll 6.0.10 release | .NET Core 2.0.7): Reference directory 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0.3\ref' does not exist. See below for details.
0>POSTSHARP(0,0): Error: PostSharp.Sdk.AssertionFailedException: Reference directory 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0.3\ref' does not exist.
0>POSTSHARP(0,0): Error: at ^5f\.Fokwdyk\.h.^+xgA20xg(Project _0) in D:\src\PostSharp-5\Core\PostSharp.Sdk\Sdk\Extensibility\Platforms\NetStandard2BasedPlatformInfo.cs:line 84
0>POSTSHARP(0,0): Error: at ^5f\.Fokwdyk\.h.HasReferenceAssemblies(Project _0) in D:\src\PostSharp-5\Core\PostSharp.Sdk\Sdk\Extensibility\Platforms\NetStandard2BasedPlatformInfo.cs:line 46
0>POSTSHARP(0,0): Error: at PostSharp.Sdk.Extensibility.Project.^Jlrf2/yM28kT(FrameworkName _0, ^\+b5soK0S& _1) in D:\src\PostSharp-5\Core\PostSharp.Sdk\Sdk\Extensibility\Project.cs:line 371
0>POSTSHARP(0,0): Error: at PostSharp.Sdk.Extensibility.Project.^sV1/ZPAQ(ProjectConfiguration[] _0) in D:\src\PostSharp-5\Core\PostSharp.Sdk\Sdk\Extensibility\Project.cs:line 385
0>POSTSHARP(0,0): Error: at PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectInvocationParameters _0) in D:\src\PostSharp-5\Core\PostSharp.Sdk\Sdk\Extensibility\Project.cs:line 561
0>POSTSHARP(0,0): Error: at PostSharp.Sdk.Extensibility.Project.LoadProject(ProjectInvocationParameters projectInvocationParameters, Domain& domain) in D:\src\PostSharp-5\Core\PostSharp.Sdk\Sdk\Extensibility\Project.cs:line 526
0>POSTSHARP(0,0): Error: at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) in D:\src\PostSharp-5\Core\PostSharp.Hosting\PostSharpObject.cs:line 264
0>POSTSHARP(0,0): Error: at PostSharp.Hosting.Program.ExecuteImpl() in D:\src\PostSharp-5\Core\PostSharp.Hosting\Program.cs:line 861
0>The process dotnet exited with code 12.

To reproduce, all that is necessary is to start a new .NET Standard 2.0 class library project using the Visual Studio template, then add the PostSharp nuget package. No code changes are required; the failure happens immediately on trying to build the otherwise untouched project.

Regards,

Alistair

  1. Support Staff 1 Posted by PostSharp Techn... on 29 May, 2018 04:07 PM

    PostSharp Technologies's Avatar

    Hello,

    I apologize for the delay. We are aware of this issue and we are working on a fix. We came across this when testing .NET Core 2.1 SDK (2.1.300-rc1) but it may also happen with older SDKs. For us 2.0.2 SDK works fine, so as a workaround you may want to fallback to that version.

    You may force the older SDK by creating global.json file in the solution dir with the following content:

    {
      "sdk": {
        "version": "2.0.2"
      }
    }
    

    We will notify you as soon as a fix is released.

    (internal issue #16107)

    Best regards,
    Daniel

  2. Support Staff 2 Posted by PostSharp Techn... on 07 Jun, 2018 06:08 PM

    PostSharp Technologies's Avatar

    Hello,

    the bug #16107 has been fixed in the current release of PostSharp 6.0.11-preview.

    Should you need further help with this issue, don't hesitate to re-open this discussion.

    Best regards,
    -tony

  3. PostSharp Technologies closed this discussion on 07 Jun, 2018 06:08 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