VS 2012 Xaml编辑器中的System.NullReferenceException [英] System.NullReferenceException in VS 2012 Xaml Editor

查看:64
本文介绍了VS 2012 Xaml编辑器中的System.NullReferenceException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让visual studio 2012 XAML设计器在WPF项目中显示任何内容。有各种各样的问题。 例如1:
$
System.NullReferenceException

对象引用未设置为对象的实例。

  在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext,BlockingCall call,WaitHandle timeoutSignal)

   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action,Int32 targetApartmentId,WaitHandle aborted,WaitHandle timeoutSignal)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut [TValue](RemoteHandle`1 targetObject,Action action)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut [TResult,TValue](RemoteHandle`1 targetObject,Func`2 func)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem项目,IHostTextEditor编辑器,RemoteCancellationToken remoteCancelToken)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem项目,IHostTextEditor编辑器,CancellationToken cancelToken)

   at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)

I have been unable to get the visual studio 2012 XAML designer to display anything in a WPF project. There are just all sorts of problems.  e.g 1:
System.NullReferenceException
Object reference not set to an instance of an object.
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)

System.NullReferenceException

对象引用未设置为对象的实例。

System.NullReferenceException
Object reference not set to an instance of an object.

服务器堆栈跟踪:

  在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.ThreadMarshaler.MarshalIn [TResult](IRemoteObject targetObject,Func`1 func)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem,IRemoteHostTextEditor remoteEditor,IRemoteCancellationToken
remoteToken)

   在System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md,Object [] args,Object server,Object []& outArgs)

  在System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Server stack trace:
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at 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& msgData,Int32 type)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem,IRemoteHostTextEditor remoteEditor,IRemoteCancellationToken cancelToken)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService。<> c__DisplayClass2。< CreateDesignerImpl> b__0(IRemoteDesignerService d)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler。<> c__DisplayClass4`2。< MarshalOut> b__3()

  在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass2.<CreateDesignerImpl>b__0(IRemoteDesignerService d)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.NullReferenceException

对象引用未设置为对象的实例。$
  在Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectMetadata.GetAssemblyForTypeResolve(String assemblyName)

  在Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetType(ClrNamespaceIdentifier clrNamespaceIdentifier,String typeName)

  在Microsoft.Expression.DesignModel.Metadata.TypeResolver.ResolveType(ITypeId typeId)

   at Microsoft.Expression.Platform.Utility.TypeIdHandlerFactory`1.DetermineBestHandler(TypeHandler handler,IMetadataResolver typeResolver,IType type)

  在Microsoft.Expression.Platform.Utility.TypeIdHandlerFactory`1.GetHandler(IMetadataResolver typeResolver,IType type)

  在Microsoft.Expression.DesignSurface.ViewModel.SceneNodeFactory.Instantiate(SceneViewModel viewModel,DocumentNode节点)

  在Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.GetSceneNode(DocumentNode节点)

  在Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.get_RootNode()

  在Microsoft.Expression.DesignSurface.ViewModel.SceneNodeSubscription`2.SetSceneRootNodeAsTheBasisNode(SceneViewModel viewModel)

  在Microsoft.Expression.DesignSurface.Properties.AnimationEditor..ctor(KeyFrameSelectionSet keyFrameSelectionSet,AnimationSelectionSet animationSelectionSet,SceneViewModel viewModel)

  在Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel..ctor(DesignerContext designerContext,SceneDocument sceneDocument)

  在Microsoft.Expression.DesignSurface.ViewModel.XamlSceneViewModel..ctor(DesignerContext designerContext,SceneDocument sceneDocument)

  在Microsoft.Expression.DesignSurface.Documents.SceneDocument.CreateSceneView()

  在Microsoft.Expression.DesignSurface.DocumentViewContext.CreateAndOpenView(ISourceItemContext sourceItem,CancellationToken cancelToken,Boolean activate,Boolean ensureOpen)

  在Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem项目,IHostTextEditor编辑器,CancellationToken cancelToken)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService。<> c__DisplayClass9。< Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner> b__8()

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler。<> c__DisplayClass19`1。< MarshalIn> b__18()

  在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.NullReferenceException
Object reference not set to an instance of an object.
   at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.XamlProjectMetadata.GetAssemblyForTypeResolve(String assemblyName)
   at Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetType(ClrNamespaceIdentifier clrNamespaceIdentifier, String typeName)
   at Microsoft.Expression.DesignModel.Metadata.TypeResolver.ResolveType(ITypeId typeId)
   at Microsoft.Expression.Platform.Utility.TypeIdHandlerFactory`1.DetermineBestHandler(TypeHandler handler, IMetadataResolver typeResolver, IType type)
   at Microsoft.Expression.Platform.Utility.TypeIdHandlerFactory`1.GetHandler(IMetadataResolver typeResolver, IType type)
   at Microsoft.Expression.DesignSurface.ViewModel.SceneNodeFactory.Instantiate(SceneViewModel viewModel, DocumentNode node)
   at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.GetSceneNode(DocumentNode node)
   at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.get_RootNode()
   at Microsoft.Expression.DesignSurface.ViewModel.SceneNodeSubscription`2.SetSceneRootNodeAsTheBasisNode(SceneViewModel viewModel)
   at Microsoft.Expression.DesignSurface.Properties.AnimationEditor..ctor(KeyFrameSelectionSet keyFrameSelectionSet, AnimationSelectionSet animationSelectionSet, SceneViewModel viewModel)
   at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel..ctor(DesignerContext designerContext, SceneDocument sceneDocument)
   at Microsoft.Expression.DesignSurface.ViewModel.XamlSceneViewModel..ctor(DesignerContext designerContext, SceneDocument sceneDocument)
   at Microsoft.Expression.DesignSurface.Documents.SceneDocument.CreateSceneView()
   at Microsoft.Expression.DesignSurface.DocumentViewContext.CreateAndOpenView(ISourceItemContext sourceItem, CancellationToken cancelToken, Boolean activate, Boolean ensureOpen)
   at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass9.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__8()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass19`1.<MarshalIn>b__18()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

 



例如2:
$
System.NotSupportedException

尝试从网络位置加载程序集,这会导致程序集在以前版本的.NET中被沙箱化框架。此版本的.NET Framework默认情况下不启用CAS策略,因此此负载可能很危险。
如果此加载不是用于沙盒装配,请启用loadFromRemoteSources开关。有关更多信息,请参阅
http://go.microsoft.com/fwlink/?LinkId=155569 信息。

  在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext,BlockingCall call,WaitHandle timeoutSignal)

   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action,Int32 targetApartmentId,WaitHandle aborted,WaitHandle timeoutSignal)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut [TValue](RemoteHandle`1 targetObject,Action action)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut [TResult,TValue](RemoteHandle`1 targetObject,Func`2 func)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem项目,IHostTextEditor编辑器,RemoteCancellationToken remoteCancelToken)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem项目,IHostTextEditor编辑器,CancellationToken cancelToken)

  在Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)


eg 2:
System.NotSupportedException
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)

System.NotSupportedException

尝试从网络位置加载程序集这会导致程序集在以前版本的.NET Framework中被沙箱化。此版本的.NET Framework默认情况下不启用CAS策略,因此此负载可能很危险。
如果此加载不是用于沙盒装配,请启用loadFromRemoteSources开关。有关更多信息,请参阅
http://go.microsoft.com/fwlink/?LinkId=155569 信息。

System.NotSupportedException
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

服务器堆栈跟踪:

  在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.ThreadMarshaler.MarshalIn [TResult](IRemoteObject targetObject,Func`1 func)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem,IRemoteHostTextEditor remoteEditor,IRemoteCancellationToken
remoteToken)

  &NBSP;在System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md,Object [] args,Object server,Object []& outArgs)

  在System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Server stack trace:
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at 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& msgData,Int32 type)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem,IRemoteHostTextEditor remoteEditor,IRemoteCancellationToken cancelToken)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService。<> c__DisplayClass2。< CreateDesignerImpl> b__0(IRemoteDesignerService d)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler。<> c__DisplayClass4`2。< MarshalOut> b__3()

  在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass2.<CreateDesignerImpl>b__0(IRemoteDesignerService d)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.NotSupportedException

尝试从a加载程序集网络位置会导致程序集在以前版本的.NET Framework中被沙箱化。此版本的.NET Framework默认情况下不启用CAS策略,因此此负载可能很危险。
如果此加载不是用于沙盒装配,请启用loadFromRemoteSources开关。有关更多信息,请参阅
http://go.microsoft.com/fwlink/?LinkId=155569 信息。

   at System.Reflection.RuntimeAssembly.nLoadFile(String path,Evidence evidence)

  在System.Reflection.Assembly.LoadFile(String path)

  在Microsoft.Expression.Utility.AssemblyHelper.LoadFile(String path)

  在Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.CreateClassicShadowCopy(IHostProject project,String assemblySourcePath)

  在Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveShadowCopyAssembly(IHostProject项目,字符串路径)

  在Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveAssembly(IHostProject项目,字符串路径)

  在Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(String path)

  在Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(IHostReferenceItem reference)

  在Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateAssemblyReferences(IEnumerable`1 referencesToUpdate)

  在Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver..ctor(IHostProject project,DesignerContext designerContext)

  在Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService。< .ctor> b__0(IHostProject项目)

  在Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection`2.CreateItems(TKey key)

  在System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key,Func`2 valueFactory)

  在Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection`2.GetItem(TKey key)

  在Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.GetProjectAssemblyResolver(IHostProject项目)

  在Microsoft.Expression.DesignSurface.Project.ProjectContextBase.Initialize()

  在Microsoft.Expression.DesignSurface.Project.XamlProjectContext.Initialize()

  在Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetProjectContext(IHostProject项目,IPlatform平台,布尔创建)

  在Microsoft.Expression.DesignSurface.Project.ProjectContextManager。< GetReferencedProjects> d__b.MoveNext()

  在System.Linq.Enumerable。< ConcatIterator> d__71`1.MoveNext()

  在System.Linq.Enumerable。< OfTypeIterator> d__aa`1.MoveNext()

  在Microsoft.Expression.DesignSurface.Project.ProjectContextBase.UnbuiltTypeDescriptionInformationProvider.FindUnbuiltType(String key)

  在Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetUnbuiltType(String key)

  在Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetType(ClrNamespaceIdentifier clrNamespaceIdentifier,String typeName)

  在Microsoft.Expression.DesignModel.Metadata.TypeResolver.ResolveType(ITypeId typeId)

  在Microsoft.Expression.DesignModel.Metadata.ProjectNeutralTypesAttributeTable.ResolveType(ITypeResolver typeResolver,ITypeId typeId)

  在Microsoft.Expression.DesignModel.Metadata.ProjectNeutralTypesAttributeTable.RegisterDataGridAttributeTable(ITypeResolver typeResolver)

  在Microsoft.Expression.WpfPlatform.WpfPlatform.RefreshProjectSpecificMetadata(ITypeResolver typeResolver,ITypeMetadataFactory typeMetadataFactory)

  在Microsoft.Expression.DesignSurface.Project.ProjectContextBase.Initialize()

  在Microsoft.Expression.DesignSurface.Project.XamlProjectContext.Initialize()

  在Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetProjectContext(IHostProject项目,IPlatform平台,布尔创建)

  在Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetSourceItemContext(IHostSourceItem sourceItem)

  在Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem项目,IHostTextEditor编辑器,CancellationToken cancelToken)

  在Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService。<> c__DisplayClass9。< Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner> b__8()

  在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler。<> c__DisplayClass19`1。< MarshalIn> b__18()

  在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.NotSupportedException
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at Microsoft.Expression.Utility.AssemblyHelper.LoadFile(String path)
   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.CreateClassicShadowCopy(IHostProject project, String assemblySourcePath)
   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveShadowCopyAssembly(IHostProject project, String path)
   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveAssembly(IHostProject project, String path)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(String path)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(IHostReferenceItem reference)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateAssemblyReferences(IEnumerable`1 referencesToUpdate)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver..ctor(IHostProject project, DesignerContext designerContext)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.<.ctor>b__0(IHostProject project)
   at Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection`2.CreateItems(TKey key)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection`2.GetItem(TKey key)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.GetProjectAssemblyResolver(IHostProject project)
   at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.Initialize()
   at Microsoft.Expression.DesignSurface.Project.XamlProjectContext.Initialize()
   at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetProjectContext(IHostProject project, IPlatform platform, Boolean create)
   at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.<GetReferencedProjects>d__b.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
   at System.Linq.Enumerable.<OfTypeIterator>d__aa`1.MoveNext()
   at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.UnbuiltTypeDescriptionInformationProvider.FindUnbuiltType(String key)
   at Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetUnbuiltType(String key)
   at Microsoft.Expression.DesignModel.Metadata.TypeResolver.GetType(ClrNamespaceIdentifier clrNamespaceIdentifier, String typeName)
   at Microsoft.Expression.DesignModel.Metadata.TypeResolver.ResolveType(ITypeId typeId)
   at Microsoft.Expression.DesignModel.Metadata.ProjectNeutralTypesAttributeTable.ResolveType(ITypeResolver typeResolver, ITypeId typeId)
   at Microsoft.Expression.DesignModel.Metadata.ProjectNeutralTypesAttributeTable.RegisterDataGridAttributeTable(ITypeResolver typeResolver)
   at Microsoft.Expression.WpfPlatform.WpfPlatform.RefreshProjectSpecificMetadata(ITypeResolver typeResolver, ITypeMetadataFactory typeMetadataFactory)
   at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.Initialize()
   at Microsoft.Expression.DesignSurface.Project.XamlProjectContext.Initialize()
   at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetProjectContext(IHostProject project, IPlatform platform, Boolean create)
   at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetSourceItemContext(IHostSourceItem sourceItem)
   at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass9.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__8()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass19`1.<MarshalIn>b__18()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

我如何确保解决这些问题?

How can I ensure these are resolved?

Stefan

推荐答案

任何解决方案?我们遇到同样的问题!

any solutions? we have the same problem!

问候

托马斯


这篇关于VS 2012 Xaml编辑器中的System.NullReferenceException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆