PostSharp requires targeting pack that is not really needed

jonyadamit's Avatar

jonyadamit

03 Sep, 2017 10:06 AM

After upgrading from version 5.0.31 to 5.0.32, PostSharp throws a warning stating:

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

None of my projects target that platform.
The issue was fixed by installing the targeting pack, but it seems like a bug to me.

  1. Support Staff 1 Posted by PostSharp Techn... on 04 Sep, 2017 01:11 PM

    PostSharp Technologies's Avatar

    Hello,

    PostSharp needs to generate the mappings between the current run-time platform and the target platform. The reported message can be caused by PostSharp executing under .NET 4.7 while the project's target platform has a different version.

    So far this seems to be the expected behavior.

    -alex

  2. 2 Posted by jonyadamit on 04 Sep, 2017 05:25 PM

    jonyadamit's Avatar

    But that is exactly the bug!
    .NET 4.7 was not installed, nor it's SDK, and no project of mine was targeting it.
    Please explain how any of this seems OK to you.

  3. Support Staff 3 Posted by PostSharp Techn... on 05 Sep, 2017 09:20 AM

    PostSharp Technologies's Avatar

    Hello,

    If the message showed up without .NET 4.7 installed, then it is a strange behavior and indeed a bug. Let's look again at what actually happened. This is our understanding:

    • The .NET Framework 4.7 was installed on a machine, most probably as a Windows update.
    • Since .NET 4.7 is an in-place update, PostSharp was executing using .NET 4.7 runtime.
    • The mappings between .NET 4.7 and the target framework didn't exist yet, so PostSharp attempted to generate them.
    • .NET Framework 4.7 SDK was not installed, so PostSharp showed the warning message.

    Without .NET Framework 4.7 installed on a machined, there should be no way for PostSharp to know about 4.7 version and to generate the string ".NETFramework,Version=v4.7" in the warning message.

    Looking at the warning message again, I see that it can be a bit misleading and can be improved.

    -alex

  4. 4 Posted by jonyadamit on 06 Sep, 2017 06:10 AM

    jonyadamit's Avatar

    Hi, you are correct.
    I wasn't aware .NET Framework 4.7 was included by default with the Windows 10 Creators Update.
    Still, I don't see the necessity of this warning. If I target a specific framework, I shouldn't need to install the SDK of another that I don't need.
    Since PostSharp only issues a warning I suppose it handles this situation well. I wonder what is the purpose of the warning and if it is really needed.

  5. Support Staff 5 Posted by PostSharp Techn... on 06 Sep, 2017 09:29 AM

    PostSharp Technologies's Avatar

    Hi,

    You're right that PostSharp should be able to generate the mappings without requiring the run-time platform's SDK. While the build will most probably work without the SDK in the current version, we emit a warning because it's more reliable to have the SDK installed. Based on your feedback we have filed an issue (#15436) to improve the mappings generation if possible or to improve the warning message at least.

    -alex

  6. 6 Posted by jonyadamit on 07 Sep, 2017 11:36 AM

    jonyadamit's Avatar

    Thank you, have a great day.

  7. jonyadamit closed this discussion on 07 Sep, 2017 11:36 AM.

  8. PostSharp Technologies re-opened this discussion on 18 Sep, 2017 12:23 PM

  9. Support Staff 7 Posted by PostSharp Techn... on 18 Sep, 2017 12:23 PM

    PostSharp Technologies's Avatar

    Hello,

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

    Best regards,
    -tony

  10. PostSharp Technologies closed this discussion on 18 Sep, 2017 12:23 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