Visual studio 2010 打开silverlight应用程序时发生异常

Visual studio 2010 打开silverlight应用程序时发生异常,visual-studio-2010,silverlight,Visual Studio 2010,Silverlight,在VS2010中,打开Silverlight应用程序时出现以下错误: System.NullReferenceException:对象引用未设置为对象的实例。 在Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.d_u8.MoveNext()中 位于MS.Internal.Design.Metadata.ReflectionProjectNode

在VS2010中,打开Silverlight应用程序时出现以下错误:

System.NullReferenceException:对象引用未设置为对象的实例。

在Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.d_u8.MoveNext()中 位于MS.Internal.Design.Metadata.ReflectionProjectNode.buildIncsumption()处 位于MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(标识符) 位于MS.Internal.Design.Markup.xmlement.BuildScope(PrefixScope parentScope,IParseContext上下文) 位于MS.Internal.Design.Markup.xmlement.convertoxaml(Xamlement父级、PrefixScope父级、iParSext上下文、IMarkupSourceProvider提供程序) 位于MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(布尔转换错误) 位于MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem()处 在Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem()中 在Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState()中 在MS.Internal.Host.PersistenceSubsystem.Load()处 在MS.Internal.Host.Designer.Load()处 在MS.Internal.Designer.VSDesigner.Load()处 在MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()中 在MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView视图)中 位于MS.Internal.Host.IsolatedDesigner.bootstrapRoxy.LoadDesigner(IsolatedDesigner工厂,IsolatedView视图) 位于MS.Internal.Host.IsolatedDesigner.bootstrapRoxy.LoadDesigner(IsolatedDesigner工厂,IsolatedView视图) 在MS.Internal.Host.IsolatedDesigner.Load()处 在MS.Internal.Designer.DesignerPane.LoadDesignerView()上
现在我想说的是,在我的电脑上安装了Microsoft Silverlight、Microsoft Silverlight 3 SDK和Microsoft Silverlight 4 SDK。在我得到这个异常的项目中,我使用的是Silverlight3SDK


如何解决此问题?

检查xaml实现代码中的silverlight代码似乎未填充变量d_u8,或者变量为null或未引用

检查这个

用记事本打开*.csproj文件并检查以下行:

<ApplicationDefinition Include="App.xaml">
  <Generator>MSBuild:Compile</Generator>
  <SubType>Designer</SubType>
</ApplicationDefinition>

MSBuild:编译
设计师

它必须存在于*.csproj文件中

尝试删除项目的
bin
obj
文件夹并重新生成。如果仍然存在问题,请查看是否可以将其缩小到一个或两个XAML页面/代码隐藏文件。如果您可以将问题缩小到几个文件,请编辑您的问题,以包括您认为在VS设计器中导致问题的代码。没有这些信息,我们将无法重现您的问题,因此无法进一步帮助您。Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.d_8.MoveNext()好的,检查这个,它可能会有帮助,那么我需要在这里执行什么配置?是的,在csproj文件中配置相同安装Microsoft Visual Studio 2010 Service Pack 1。