Using Vector3 in code behind crashed Visual Studio XAML designer

0

In my UWP app project using Visual Studio 2015 Update 3, I have a custom control that references Vector3 class to apply some shadow effect in code behind.

In another page where I use this custom control, the XAML designer crashes with the following error:

BadImageFormatException: Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)

The problem seems to only happen during design time. When I run the app everything works normally.

Removing the use of Vector3 object from my custom control's code behind solves the problem but it's not a good solution. The debug config for my project is x86.

Can you please advise on how can I avoid this crash?

visual-studio
xaml
uwp
asked on Stack Overflow Oct 15, 2016 by disklosr

1 Answer

0

Thank you for reporting this issue.

For Visual Studio related feedback, please submit it to Connect portal site

I've created a feedback for you in here: https://connect.microsoft.com/VisualStudio/feedback/details/3107712/method-not-found-exception-in-vs-xaml-designer

I fully understood this is not user-friendly. If it doesn't hinder your dev process, could you please comment that code and completed all UI things, then uncomment it later as a temporary solution :)


User contributions licensed under CC BY-SA 3.0