24

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 assembly is built with an older version of blend sdk and is not supported in a windows presentation foundation 4 project

Domysee
  • 12,718
  • 10
  • 53
  • 84

8 Answers8

40
  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

KavenG
  • 161
  • 1
  • 9
Lücks
  • 3,806
  • 2
  • 40
  • 54
  • Thanks so muck for this post! This is brilliant answer! – Dmitrii Polianskii Sep 26 '16 at 17:45
  • 3
    Worked for me. Thank you very much! Just think you can clarify that it's the Developer cmd prompt for VS, not the generic Windows one – Moe45673 Dec 19 '16 at 17:31
  • 13
    You can also fix that problem by downloading the latest NuGet package from Microsoft: https://www.nuget.org/packages/Expression.Blend.Sdk.WPF/ using `Install-Package Expression.Blend.Sdk.WPF` from Package Manager Console. – Alex Jan 06 '17 at 17:04
  • 3
    @Alex - that didn't fix it for me. – hyankov Jan 13 '17 at 13:29
  • 3
    Use the 'Developer Command Prompt for VS2015' instead of regular cmd if you have Visual Studio 2015 installed. http://stackoverflow.com/a/40434598/3895469 – oddRaven May 15 '17 at 10:41
  • 1
    @HristoYankov, FWIW, the [System.Windows.Interactivity.WPF](https://www.nuget.org/packages/System.Windows.Interactivity.WPF/) NuGet package works for me. :-) – skst Aug 28 '17 at 15:05
  • @HristoYankov This also worked for me just now: nuGet: Microsoft.Expression.Blend.SDK.WPF by Matthew Hayhurst Cheers! – DaWiseguy Jan 25 '18 at 23:15
10

You can resolve this issue by manually changing the version numbers in .sln and .csproj files.

In .csproj and .csproj.user change ToolsVersion to your current Visual Studio version. VS 2013 is version 12, VS 2015 is version 14.

In .sln change VisualStudioVersion to the current version, you can find it in the About window.

Also change Microsoft Visual Studio Solution File, Format Version to your current version (eg 14.00, 12.00)

Note: This only works for built-in assemblies. If external dependencies (like Prism) cause this error, you'd have to recompile them using the new Blend SDK. You could also try to update the dependency, maybe the newest version is already compiled using the latest Blend SDK.

Domysee
  • 12,718
  • 10
  • 53
  • 84
  • I have the same error, with the Prism library when using their "InteractionRequestTrigger" mechanism. The solution provided here did unfortunately not help. – tmatuschek Oct 12 '15 at 09:51
  • 1
    @tmatuschek this solution only works for built in types. I believe your Prism dll was built with an older version of the SDK. To get rid of the error you need a Prism dll that was built with the new version of the SDK (with Visual Studio 2015). Maybe try downloading the newest version of the Prism dll. – Domysee Oct 12 '15 at 09:59
  • Thanks for the reply. And I think you are correct in assuming I need a new version of Prism built with the correct version of the Blend SDK. Unfortunately I'm already using the latest release of the Prism libs (6.0.1). I have posted an issue on the Prism github. I just wanted to comment on this here if anybody else ends up here that is having the same issue. – tmatuschek Oct 12 '15 at 10:54
  • @tmatuschek Great. I've updated the answer to indicate that this works only for built-in types. Could you post a link to the Github issue so that other people who are getting the error for Prism can immediately follow it? – Domysee Oct 12 '15 at 11:21
  • 1
    Yes, of course, I thought I did that already! Here it is: https://github.com/PrismLibrary/Prism/issues/213 – tmatuschek Oct 12 '15 at 11:54
  • 1
    This also does not work for custom behaviors defined in the same assembly. It really only works for Blend behaviors defined in Microsoft.Expression.Interactions – Kobi Hari Dec 08 '15 at 17:37
  • If I could pay you something I would. I spent hours, and hours, trying to regain my design-time support recently lost. THANK YOU! – Jason Stevenson Oct 10 '16 at 14:28
8

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.

Terrence
  • 747
  • 1
  • 10
  • 27
3

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?

skst
  • 575
  • 9
  • 15
2

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.

Ryan Roos
  • 558
  • 12
  • 18
0

Just the Microsoft Visual Studio Solution File, Format Version change to 14.00 worked for me.

zealoustechie
  • 83
  • 1
  • 7
0

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.

hillin
  • 1,603
  • 15
  • 21
0

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.