error PS0219: The targeting pack for platform ".NETFramework,Version=v2.0" is not installed after update from 4.3.15 to 6.0.25

pietvredeveld's Avatar

pietvredeveld

22 Aug, 2018 06:48 AM

Hi,

After updating my solution from postharp 4.3.15 to 6.0.25 i'll get on the TFS 2015 build the following ERROR:
POSTSHARP : error PS0219: The targeting pack for platform ".NETFramework,Version=v2.0" is not installed. Please install the appropriate targeting pack. [E:\agent1\_work\1\s\***\***.csproj]
The project is targeting .Net Framework 4.6.x. The build agent run on Windows Server 2016 Datacenter with .Net Framework 4.7.1. SDK installed.
The suggestion you made in http://support.sharpcrafters.com/discussions/problems/5289-warning-ps0219-the-targeting-pack-for-platform-netframeworkversionv20-is-not-installed-please-install-the-appropriate-targeting-pack will not work because the server let me not install the 2.0 SDK because it has already installed the 3.5 SDK.

Can you please help me out

Kind regard
Piet

  1. Support Staff 1 Posted by PostSharp Techn... on 22 Aug, 2018 10:33 AM

    PostSharp Technologies's Avatar

    Hello Piet,

    let me split my answer into 3 areas:

    1) Cause of this issue:
    Your project is probably referencing a library compiled for .NET Framework 2.0. You can have a look to obj\$(Configuration)\PostSharp\postsharp.config to see which reference assemblies PostSharp considers when building your project.

    2) Ignoring this issue:
    As mentioned in the linked ticket, you may ignore this warning as long as you don't experience any issues. You mention that you see this as an error instead of a warning. Do you have "treat warnings as errors" set up? See http://doc.postsharp.net/ignoring-warnings for more details on ignoring and escalating warnings.

    3) Getting the missing reference libraries:
    For .NET Framework 2.0, the reference libraries come with the .NET Framework 3.5 feature of windows. See https://docs.microsoft.com/en-us/dotnet/framework/install/dotnet-35... for details on installing this feature. (On Windows Server, you'll be taken through Server Manager, there you choose "Add roles and features".)

    Best regards,
    -tony

  2. 2 Posted by pietvredeveld on 24 Aug, 2018 05:31 AM

    pietvredeveld's Avatar

    Thanks for your'e response. The cause of this issue I'll still can't find but the suggestions to ignore the issue helpt enough to have a successful build now.
    Thanks again. The case can be closed for me.

    Regards,
    Piet

  3. Support Staff 3 Posted by PostSharp Techn... on 27 Aug, 2018 01:46 PM

    PostSharp Technologies's Avatar

    Hello Piet,

    we have reviewed the behavior and we've realized that it's not correct. Since PostSharp 6.0.26 and PostSharp 6.1.2, you shouldn't be asked for a targeting pack for a framework of a lower version than the target framework. (This bug is files as issue #16531 internally.)

    Best regards,
    -tony

  4. 4 Posted by pietvredeveld on 27 Aug, 2018 02:48 PM

    pietvredeveld's Avatar

    Hi Tony,

    After my hollyday (until mid September) I'll look into it and will reply
    then in detail.

    Regards,
    Piet

    Op ma 27 aug. 2018 15:46 schreef PostSharp Technologies <
    [email blocked]>:

  5. Support Staff 5 Posted by PostSharp Techn... on 11 Sep, 2018 03:52 PM

    PostSharp Technologies's Avatar

    Hello Piet,

    the bugfix for the issue #16531 has been released as part of PostSharp 6.0.26. We are going to close this discussion now. If you need further help, feel free to reopen it.

    Enjoy your vacation!

    Best regards,
    -tony

  6. PostSharp Technologies closed this discussion on 11 Sep, 2018 03:52 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