简体   繁体   中英

System.Runtime.RemotingException in simple XAML file

I have a WPF application which is giving me a very very annoying error

System.Runtime.Remoting.RemotingException [12068] Designer process terminated unexpectedly!

The number between [] changes each time

The XAML is very simple

<UserControl x:Class="STC.Reports.ReportGenerator.Views.MainWindow"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</UserControl>

This has wasted me hours and hours

Does anyone know anything that could help?

I cant get any more information than that above

Even though I have told VS to break on these Exceptions it doesnt

I have also tried to attach another VS and that makes no difference

I have repaired my installation of VS (2012 Professional)

I have also updated to Update 3

This is even happening when I create a brand new WPF application

Everything seems fine initially, then VS just hangs and the remoting error occurs

Paul

What kind of message are You getting?

If it is a Messagebox when You try to use designer - it is a known issue since VS2010 as far as I remember. It is frequently caused by a video card or its driver, so the easiest way is trying to update your video driver or use some older version. Sometimes that help.

The other way is not to use built-in designer. As for me, I wite pure xaml and it seems to be more convenient and faster way of development. Or, if You like visual UI - You may use Blend. AFAIK it is a part of VS2012 now.

I had this error occur for all windows/controls in a project, even if they were brand new empty windows. I had a markup extension causing a design-time exception (with no indication of this from Visual Studio) and I would get this designer error if I used the markup extension in any project resource dictionaries.

Old post but might be useful for future developers who run into this kind of problem.

I had this exact behaviour. Turned out to be a problem related to my viewmodel. At runtime everything works, but at design time VS will try to load the viewmodel standalone and things got haywire. My viewmodel depended on some global object which I created elsewhere at application startup. Loading the viewmodel standalone creates a exception since the global object was missing.

Quite easy to detect actualy. Just test your viewmodel by instantiating it yourself from code. If it fails VS won't be able to run the designer as well and as you see VS unfortunately won't tell you what happened.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM