the type from assembly is built with an older version of blend sdk and is not supported in a windows presentation foundation 4 project

前端 未结 8 2000
半阙折子戏
半阙折子戏 2020-12-08 07:22

I created a WPF project in VS 2013. After upgrading to VS 2015, this error showed in the designer on types derived from the Blend SDK:

the type from a

相关标签:
8条回答
  • 2020-12-08 08:03

    The popular answer is valid, but since things are always changing in the developer world, I thought I would note that there's a (IMO) better solution now.

    In December 2018, Microsoft released an official, open source, supported NuGet package for XAML behaviors for WPF. (There's a separate one for UWP.) It's very easy to migrate to this package. You need to uninstall your current NuGet package, remove a couple of references, install this package, and change a using statement (or FQN).

    https://www.nuget.org/packages/Microsoft.Xaml.Behaviors.Wpf/

    https://devblogs.microsoft.com/dotnet/open-sourcing-xaml-behaviors-for-wpf/

    I read about it in this SO answer, so credit goes to that OP:

    How to add System.Windows.Interactivity to project?

    0 讨论(0)
  • 2020-12-08 08:04

    Was having a similar problem using Visual Studio 2017 but none of the answers above fully resolved it for me. Found a Microsoft developer community page that had a workaround that did the trick. Comment by Bran Hagger recommended deleting the .vs folder from the solution's directory. This additional step cleared out the cache and caused Visual Studio to rebuild it.

    0 讨论(0)
  • 2020-12-08 08:06

    This also could be that you are mixing different versions of System.Windows.Interactivity.dll, especially if you are getting the SDK from nuget where several different packages provide it, e.g.:

    https://www.nuget.org/packages/Expression.Blend.Sdk/ https://www.nuget.org/packages/System.Windows.Interactivity.WPF/

    In this case, you'll have to synchronize these libraries among projects.

    0 讨论(0)
  • 2020-12-08 08:08

    Deleting the .vs file in the solution folder solved the issue. The issue happened for me after I updated My Visual Studio 2017 and Opened the project that was built before with an older version of Visual studio 2017.

    0 讨论(0)
  • 2020-12-08 08:17
    1. Run Command Prompt as Administrator

    2. Change Directory to Blend SDK: cd C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.5\Libraries\

    3. Register DLL: gacutil -i System.Windows.Interactivity.dll

    4. Restart Visual Studio

    Reference: https://connect.microsoft.com/VisualStudio/feedback/details/755407/xaml-designer-will-not-display-when-using-blend-sdk-behaviors

    0 讨论(0)
  • 2020-12-08 08:26

    None of the other answers here worked for me. What finally solved it was deleting the .NET v4.0 version of the file in the SDK folder:

    C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries\
    

    I am referencing the v4.5 file via NuGet, but it seems that the designer was finding the file in the above folder. The v4.0 file was not registered in the GAC.

    0 讨论(0)
提交回复
热议问题