什么原因导致VS 2010 SP1 WPF Designer崩溃? [英] What causes the VS 2010 SP1 WPF Designer to crash?
问题描述
在以下情况下,VS2010 WPF设计器中的各种机器上出现崩溃:
We're experiencing crashes on various machines in the VS2010 WPF designer in the following scenario:
- 安装了VS 2010 SP1
- 64位Windows 7
- 参考NHibernate.dll(版本1.2.0.712)
要重现错误,请创建一个新的WPF解决方案,执行以下操作:
To reproduce the Error, create a new WPF Solution, perform the following actions:
- 创建一个新的WPF解决方案
- 打开主窗口,添加文本框,设置一些静态文本
- 添加对FluentNhibernate.dll 1.2.2.712版本的引用
- 清除并重建解决方案
- 在设计器中再次打开主窗口,在设计器中编辑文本
- create a new WPF solution
- open the main window, add a textbox to it, set some static text
- add a reference to FluentNhibernate.dll, Version 1.2.0.712
- Clean and Rebuild the solution
- Open main window in designer again, edit text
- in the designer, click left of the window, then back into the textbox again
没有数据/命令绑定,没有代码引用FluentNHibernate功能或任何东西高度复杂,只是一个新的WPF解决方案与MainWindow.xaml中的以下XAML:
There's no Data / Command Bindings, no code that references FluentNHibernate functionality or anything highly sophisticated, just a new WPF Solution with the following XAML in the MainWindow.xaml :
<Window x:Class="testWpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="800"
Title="MainWindow" Height="350" >
<Grid>
<TextBox Text="yxcydfdssdfsdfdsfsdsddsasdyxcasd" />
</Grid>
</Window>
这里是完整的Stacktrace:
Here's the complete Stacktrace:
System.Reflection.TargetInvocationException
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
System.NullReferenceException
Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.GetRuntimeTypeVariable(Type type)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.GetRuntimeType(Type type)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.EnsureRuntimeType(Type type)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.GetRuntimeType(Type type)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkType.TryGetRuntimeType()
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.EnsureRuntimeType(Type type)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkProvider.GetRuntimeType(Type reflectionType)
at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.VsReflectionResolver.GetRuntimeType(Type reflectionType)
at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.CachingReflectionResolver.GetRuntimeType(Type reflectionType)
at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.Microsoft.Windows.Design.Metadata.IReflectionResolver.GetRuntimeType(Type reflectionType)
at MS.Internal.Metadata.ClrType.get_RuntimeMember()
at MS.Internal.Metadata.ClrMember`1.Microsoft.Windows.Design.Metadata.Reflection.IReflectionMember.get_MemberInfo()
at MS.Internal.Metadata.ClrType.Equals(Object obj) at System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.<>c__DisplayClass5.<FindAttachableProperties>b__4(ITypeMetadata walkType)
at MS.Internal.Design.Metadata.Xaml.XamlType.<GetAllAttachableProperties>d__7.MoveNext()
at MS.Internal.Design.Metadata.Xaml.XamlType.<FindAttachableProperties>d__0.MoveNext()
at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.<FindAttachableProperties>d__7.MoveNext()
at MS.Internal.VirtualModel.VirtualModelPropertyCollection.<GetUncachedProperties>d__0.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at MS.Internal.VirtualModel.VirtualModelPropertyCollection.GetEnumerator()
at MS.Internal.Designer.PropertyEditing.Model.Properties.ModelPropertyMerger.<GetFirstProperties>d__0.MoveNext()
at MS.Internal.Designer.PropertyEditing.Views.PropertyEntryReader.RedraftEntries(IPropertyViewManager viewManager, Selection selection, Boolean attachedOnly, IEventCodeBehindProxy eventCodeBehindProxy, CategoryList categoryList)
at MS.Internal.Designer.PropertyEditing.PropertyInspector.UpdateCategories(Selection selection, Boolean attachedOnly, IEntryReader entryReader)
at MS.Internal.Designer.PropertyEditing.PropertyInspector.RefreshPropertyList(Boolean attachedOnly)
at MS.Internal.Designer.PropertyEditing.PropertyInspector.OnSelectionChangedIdle()
MS已将此确认为SP1错误,但为了获得满意的结果,我需要更多地了解此问题...
MS has confirmed this as a SP1 Bug, but for a satisfactory outcome, I need to understand more about the issue...
这是什么原因,为什么它只发生在addind FNH,为什么只有当从某个位置添加它(组件是相同的 - 我们做一个字节比较)?不带SP1的,它的工作原理...
What causes this, why does it occur only when addind FNH, why only when adding it from a certain location (assembly is the same - we did a bytewise comparison)? Without SP1, it works...
推荐答案
我们有时会解决这个问题,加入
We sometimes get around this by adding
if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
return;
在加载的违规控件的事件
in the loaded event of the offending control
这篇关于什么原因导致VS 2010 SP1 WPF Designer崩溃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!