为什么在一个全新的,未改变的Silverlight项目上加载XAML文件?

时间:2013-07-17 23:46:24

标签: silverlight xaml silverlight-4.0

为什么在一个全新的,未改变的Silverlight项目上加载XAML文件?

这是我第一次使用Visual Studio 2010在当前机器上启动一个silverlight项目。到目前为止,我一直在编写ni ASP.NET。

当我第一次尝试启动一个新的Silverlight项目时,有人告诉我需要安装Silverlight的新副本。我不得不卸载Silverlight以及我的Silverlight SDK版本。卸载并重新安装(现在我有Microsoft Silverlight 5.1.20513.0和Silverlight 4 SDK 4.0.50826.0)后,我终于能够创建一个Silverlight项目。但是XAML代码立即无法在IDE中加载

http://i67.photobucket.com/albums/h292/Athono/ASP_DOT_NET%20and%20CSS/outofthegate02_zps0bd33d95.png

<UserControl x:Class="SilverlightApplication4.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

<Grid x:Name="LayoutRoot" Background="White">

</Grid>

http://i67.photobucket.com/albums/h292/Athono/ASP_DOT_NET%20and%20CSS/outofthegate01_zpse0f20845.png

   System.NullReferenceException
     

对象引用未设置为对象的实例。      在Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.d__8.MoveNext()      在MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption()      在MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(标识符标识符)      在MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope,IParseContext context)      在MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement父级,PrefixScope parentScope,IParseContext上下文,IMarkupSourceProvider提供程序)      在MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors)      在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.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory工厂,IsolatedView视图)      在MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory工厂,IsolatedView视图)      在MS.Internal.Host.Isolation.IsolatedDesigner.Load()      在MS.Internal.Designer.DesignerPane.LoadDesignerView()

有什么建议吗?

0 个答案:

没有答案