异常:错误 HRESULT E_FAIL 与 Microsoft LightSwitch Visual Studio 2012 RC [英] Exception: Error HRESULT E_FAIL with Microsoft LightSwitch Visual Studio 2012 RC
问题描述
我最近安装了 Visual Studio 2012 RC 以及 VS 2012 SDK 和 LightSwitch Extensibility Toolkit.
I installed Visual Studio 2012 RC recently along with VS 2012 SDK and LightSwitch Extensibility Toolkit.
这是我的 Client.Design -> TControl.XAML 文件中的 XAML 代码
this is the XAML code in my Client.Design -> TControl.XAML file
<UserControl x:Class="CustomControls.Presentation.Controls.TControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:framework="clr-namespace:Microsoft.LightSwitch.Presentation.Framework;assembly=Microsoft.LightSwitch.Client">
<Grid Width="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<framework:ContentItemPresenter ContentItem="{Binding ChildItems[0]}" Grid.Row="0" Margin="3" />
<framework:ContentItemPresenter ContentItem="{Binding ChildItems[1]}" Grid.Row="0" Margin="3" />
</Grid>
</UserControl>
我在设计器上看不到此 XAML 的输出.相反,我在设计器区域看到此错误消息:
I cannot see the output of this XAML on the designer. Instead I see this error Message up on the designer area :
Exception: Error HRESULT E_FAIL has been returned from a call to a COM component.
Stacktrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_InsertValue[T](PresentationFrameworkCollection`1 collection, UInt32 index, CValue value)
at MS.Internal.XcpImports.Collection_InsertDependencyObject[T](PresentationFrameworkCollection`1 collection, UInt32 index, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.InsertDependencyObject(Int32 index, DependencyObject value)
at System.Windows.Controls.UIElementCollection.InsertInternal(Int32 index, UIElement value)
我强烈怀疑这与此处涉及的命名空间和 Silverlight 版本有关.我的项目设置为使用 Silverlight 版本 5.
I strongly suspect this is has something to do with namespaces involved here and the Silverlight version. My project is set to use Silverlight version 5.
快速谷歌搜索和Stackoverflowing"确实揭示了有关此错误的一些一般信息,但没有太大帮助.
A quick googling and 'Stackoverflowing" did reveal some general info about this error but nothing of much help.
任何帮助将不胜感激.
推荐答案
为了在 VS2013 Ultimate 中解决这个问题,我不得不关注帖子 http://rathodkrunal.blogspot.com/2011/11/visual-studio-2010-error-hresult-efail.html
To fix this in VS2013 ultimate I had to follow the post http://rathodkrunal.blogspot.com/2011/11/visual-studio-2010-error-hresult-efail.html
其中谈到简单地清除 Visual Studio 的 ItemTemplateCache 并使用/setup 标志运行 vs 一次.
Wherein it talks about simply cleaning out Visual Studio's ItemTemplateCache and running vs with the /setup flag one time.
如果链接断开或以其他方式不可用,这里是旧版 VS 的缓存:
In case the link breaks or is otherwise unavailable here's where the cache used to be for older VS:
您可以在Program Files\Microsoft VisualStudio 10.0\Common7\IDE\ProjectTemplatesCache",然后运行devenv/setup" 再次构建缓存,看看是否有帮助.
You can delete the project cache at "Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache", then run "devenv /setup" to build the cache again to see if it helps.
这篇关于异常:错误 HRESULT E_FAIL 与 Microsoft LightSwitch Visual Studio 2012 RC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!