wpf xaml designer bug

拟墨画扇 提交于 2019-12-06 03:46:40

问题


every time we open a *.xaml file in our project - we see not working designer and a lot of messages 'type not found' 'assembly not found' etc. After a couple of experiments, i found out a root of a problem : create new WPF application, create a folder in project root, add some value converter to folder, try to use it on your 'MainWindow.xaml'

you will probably write something like this :

xmlns:Folder="clr-namespace:WpfApp.Folder"

and then

   <Window.Resources>
        <Folder:SomeValueConverter x:Key="someKey"/>
    </Window.Resources>

You know...

And, now the most interesting thing! when you build your project for x86 or 'any CPU' - everything will be just fine, designer will be available, all namespaces will be imported perfectly!BUT, just change you project configuration to x64...Rebuild solution and open design view... You'll be amazed...errors, types not found, etc... How the hell to use VS xaml designer in x64 applications?

Windows 7 enterprise x64, Visual Studio 2010 Ultimate


回答1:


Others have reported the same problem. One of the workarounds suggested was to do the design work with a 32-bit target, and then switch to 64-bit only when you're ready to compile and deploy.




回答2:


In my case, I was using an obfuscator (ConfuserEx to be exact) as a post-build step in Release configuration that was causing this behavior. Switching back to Debug configuration fixed the problem. Alternately, removing the post-build step will also fix the problem.



来源:https://stackoverflow.com/questions/5314627/wpf-xaml-designer-bug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!