Warning and error after upgrading to PostSharp 6.0.11

mope's Avatar

mope

07 Jun, 2018 08:28 AM

When upgrading existing solution from PostSharp from 5.0.44 til 6.0.11, first the following warning occurs:

warning PS0219: The targeting pack for target platform ".NETFramework,Version=v4.7" is either not installed or not properly registered. Please install the appropriate targeting pack.

But in this solution we are only using 4.7.2. Not 4.7. Why is 4.7 required? I do not have this targeting pack installed, and should not need to.

Right after the warning, the build fails with this error:

error: Unhandled exception (postsharp-x64-srv.exe 6.0.11 release | .NET Framework 4.7.2): Unknown framework name: 'Windows,Version=v1.0,Profile=x64'. See below for details.
PostSharp.Sdk.AssertionFailedException: Unknown framework name: 'Windows,Version=v1.0,Profile=x64'.
at PostSharp.Sdk.Extensibility.Platforms.PlatformInfoFactory.^BHdIRPh+(FrameworkName _0, FrameworkName _1, AssemblyProcessorArchitecture _2) at PostSharp.Sdk.Extensibility.Platforms.PlatformInfoFactory.GetPlatformInfo(FrameworkName frameworkName, FrameworkName platformName, AssemblyProcessorArchitecture processorArchitecture) at PostSharp.Sdk.Extensibility.Project.^YlzJJkX6M51U(FrameworkName _0, ^+b5soK0S& _1) at PostSharp.Sdk.Extensibility.Project.^sV1/ZPAQ(ProjectConfiguration[] _0) at PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectInvocationParameters _0) at PostSharp.Sdk.Extensibility.Project.LoadProject(ProjectInvocationParameters projectInvocationParameters, Domain& domain) at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) at PostSharp.Hosting.Program.ExecuteImpl()

What can I do to fix this?

  1. Support Staff 1 Posted by PostSharp Techn... on 07 Jun, 2018 01:46 PM

    PostSharp Technologies's Avatar

    Hello,

    the warning is probably caused by a reference assembly compiled for .NET Framework 4.7. We have filed this as issue #16149. We will investigate it further and we'll update you later. It shouldn't cause you troubles at the moment.

    The following error is probably either caused by an assembly compiled for WinRT or located in a folder named "win" or "winrt". Can you identify such assembly in your project?

    If the assembly is compiled for WinRT, there are two problems. (a) WinRT and .NET Framework are not compatible platforms and (b) PostSharp doesn't support WinRT. You might manage to find a compatible version of the referenced library.

    If the assembly is not compiled for WinRT, but placed in a folder named as stated earlier, please try to rename the folder or move the assembly to a folder with a different name and let us know that this is the case.

    Best regards,
    -tony

  2. 2 Posted by mope on 07 Jun, 2018 01:55 PM

    mope's Avatar

    Did the previous PostSharp support WinRT? Since we did not get any error earlier.

    I don't know of any assemblies which would be using WinRT (I barely now what it is). How can I identify that assembly? I don't have any folders named "win" og "winrt". I do have a "win10-x64" folder though, since this is an ASP.NET Core application with runtime identifier win10-x64.

  3. Support Staff 3 Posted by PostSharp Techn... on 07 Jun, 2018 02:32 PM

    PostSharp Technologies's Avatar

    OK, thank you for this information. So it's not a WinRT issue.

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

    In the meantime, you can work-around this either by postponing migration to PostSharp 6.0 or by renaming the folder or moving it's content to a folder with a different name.

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

    Best regards,
    -tony

  4. PostSharp Technologies closed this discussion on 07 Jun, 2018 02:32 PM.

  5. mope re-opened this discussion on 07 Jun, 2018 02:37 PM

  6. 4 Posted by mope on 07 Jun, 2018 02:37 PM

    mope's Avatar

    Renaming what folder? Is the folder name "win10-x64" causing the problem? This folder name is generated by "dotnet build", completely standard stuff.

  7. Support Staff 5 Posted by PostSharp Techn... on 07 Jun, 2018 03:00 PM

    PostSharp Technologies's Avatar

    Yes, this folder is the problem, unfortunately. The name can be changed in the project file of the project which creates this assembly by setting OutDir property like this, for example:

    <OutDir>bin/$(Configuration)/$(TargetFramework)/runtime.win10-x64</OutDir>

    Then the folder name will no longer be "win10-x64", but "runtime.win10-x64".

    Best regards,
    -tony

  8. Support Staff 6 Posted by PostSharp Techn... on 11 Jun, 2018 01:21 PM

    PostSharp Technologies's Avatar

    Hello,

    The bug should be fixed in PostSharp 6.0.12-rc. The workaround is no longer necessary.

    -gael

  9. Support Staff 7 Posted by PostSharp Techn... on 11 Jun, 2018 01:22 PM

    PostSharp Technologies's Avatar

    Hello,

    We are going to close this request as we believe it was solved. Please feel free to reopen the discussion if you need more help.

    Best regards,

    -gael

  10. PostSharp Technologies closed this discussion on 11 Jun, 2018 01:22 PM.

  11. PostSharp Technologies re-opened this discussion on 15 Jun, 2018 01:24 PM

  12. Support Staff 8 Posted by PostSharp Techn... on 15 Jun, 2018 01:24 PM

    PostSharp Technologies's Avatar

    Hello,

    we have additionally fixed the warning you were getting before the error in PostSharp 6.0.13-rc.

    Best regards,
    Daniel

  13. PostSharp Technologies closed this discussion on 15 Jun, 2018 01:24 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