未处理的异常阻止我在Blend 2012中打开一个项目

时间:2013-03-26 11:51:58

标签: c# visual-studio blend

我一直在关注MS网站上的教程并且到了这里:

http://msdn.microsoft.com/en-us/library/windows/apps/jj129435.aspx

当我切换回混合时,我遇到了一个巨大的错误,我不知道这意味着什么或如何继续:

发生了未处理的异常:

System.InvalidCastException 返回参数的类型无效。    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext,BlockingCall call,WaitHandle timeoutSignal)    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(操作操作,Int32 targetApartmentId,WaitHandle中止,WaitHandle timeoutSignal)    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(操作操作,Int32 targetApartmentId,WaitHandle中止,CallSynchronizationMode syncMode,WaitHandle timeoutSignal)    在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut [TValue](RemoteHandle 1 targetObject, Action action, CallSynchronizationMode syncMode) at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle 1 targetObject,Action 1 action, CallSynchronizationMode syncMode) at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.Initialize() at Microsoft.Expression.DesignHost.IsolatedDesignerService.CreateLease(IIsolationTarget isolationTarget, CancellationToken cancelToken, DesignerServiceEntry& entry) at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken) at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.InvokeWithCulture[T](CultureInfo culture, Func 2 func,CancellationToken cancelToken)    在Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler。&lt;&gt; c__DisplayClassa 1.<StartTask>b__6() at System.Threading.Tasks.Task 1.InnerInvoke()    在System.Threading.Tasks.Task.Execute()

System.InvalidCastException 返回参数的类型无效。

服务器堆栈跟踪:    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext,BlockingCall call,WaitHandle timeoutSignal)    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action,Int32 targetApartmentId)    在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject,Action action)    在Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.Initialize()    在System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md,Object [] args,Object server,Object []&amp; outArgs)    在System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

在[0]处重新抛出异常:    在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)    在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData,Int32 type)    在Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.Initialize()    在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.b_ a(IRemoteDesignerService d)    在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler。&lt;&gt; c _DisplayClass1`1.b__0()    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.InvalidCastException 返回参数的类型无效。    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext,BlockingCall call,WaitHandle timeoutSignal)    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(操作操作,Int32 targetApartmentId,WaitHandle中止,WaitHandle timeoutSignal)    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(操作操作,Int32 targetApartmentId,WaitHandle中止,CallSynchronizationMode syncMode,WaitHandle timeoutSignal)    在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut [TValue](RemoteHandle 1 targetObject, Action action, CallSynchronizationMode syncMode) at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle 1 targetObject,Func`2 func,CallSynchronizationMode syncMode)    在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostProject.Microsoft.Expression.DesignHost.IHostProject.get_TargetAssemblyPath()    在Microsoft.Expression.DesignSurface.DesignerService.GetComponentName(IHostProject项目)    在Microsoft.Expression.DesignSurface.DesignerService.InitializeWindowsRuntimeContext(IHostProject contextProject,IHostAppPackage appPackage)    在Microsoft.Expression.DesignSurface.DesignerService.InitializePrimaryProject()    在Microsoft.Expression.DesignSurface.DesignerService.Initialize()    在Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.b__0()    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.InvalidCastException 返回参数的类型无效。    在System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg,Type paramType)    在System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg,Object [] outArgs,Object returnValue)    在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)    在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData,Int32 type)    在Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostProject.get_TargetAssemblyPath()    在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostProject.b_ 1a(IRemoteHostProject p)    在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler。&lt;&gt; c _DisplayClass4`2.b__3()    在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

有没有人在此之前遇到过这个/知道是什么?非常感谢

1 个答案:

答案 0 :(得分:1)

微软于2012年9月11日14:05发表

  

我们已经看到了来自其他用户的类似堆栈跟踪。你是   在项目中引用.Net 2.0程序集?不幸   设计人员无法处理旧版(.Net 2.0)程序集中的类型   这导致设计师崩溃。你能试试吗   删除任何.Net 2.0程序集,看看是否修复它。

问题是与.Net 2.0相关联的项目!谁会知道。当设计师不会一直崩溃时,工作非常方便。

http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/f4af2020-ed43-4139-9dc9-759ce3b38377/