XAML Designer NotSupportedException

13 Sep

Today I got following exception when I tried to display a XAML Control in the XAML-Designer offered from Visual Studio 2012.

An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See for more information.

The exception message intended to say that you have at least one referencing assembly that you have downloaded from the internet. By default, such assemblies are blocked by the Operating System. If you open the file’s preferences, you see following string at the bottom of the window:

This file came from another computer and might be blocked to help protect this computer:

Exactly about this fact Visual Studio warns you. If you trust the creator of that assembly, you can avoid this problem by clicking Unblock.

After that, you should clean your solutions Debug and Release folder in order to ensure that the right unblocked assemblies are copied in the solutions output directory.

Then Visual Studio should continue showing the XAML designer.

Leave a comment

Posted by on September 13, 2012 in Visual Studio, WPF


Tags: ,

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: