0

I want to open an xaml file with designer preview and got the error message enter image description here

What is wrong?

It is odd, when I compiled and run it, it works.

Update

Now I've got a new error message:

System.TypeLoadException
Could not load type 'Mocks.Libraries_Classes_Storage_0_238052922' from assembly 'DesignTools_d24364d2-cc43-4719-803f-12d4ce1b7ef3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

I've forgot to mentioned I created my solution with visual studio 2013 and then upgraded visual studio to 2015. On visual studio 2013 my project works fine, no complain.

softshipper
  • 32,463
  • 51
  • 192
  • 400
  • You might want to add the code of the static constructor of `Configuration` to specifically tell what is wrong, but I don't think that is essentially your question. – Patrick Hofman Nov 30 '15 at 09:11

1 Answers1

0

You have to check the static constructor of your Configuration class. Something goes wrong there.

Usually, in my experience, when opening a designer you are much more restricted of doing things (like reading configuration files, etc.) or depend on other properties set. You usually have to check in your code if you are design mode to prevent some steps to be done. This answer might be of help: Is there a way to check if WPF is currently executing in design mode or not?.

Community
  • 1
  • 1
Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325