我有一个窗口,里面唯一的东西就是一个TextBlock。每次我更改任何东西时,我都会遇到可笑的设计师例外情况。我开始删除所有试图找出这个错误的罪魁祸首的东西。现在我什么都没有了,但设计师一直在抛出异常。
<Window x:Class="Company.Product.Views.About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="397"
Width="658">
<TextBlock>Test</TextBlock>
</Window>
后面的代码:
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class About : Window
{
public About()
{
InitializeComponent();
}
}
如果我“单击此处重新加载设计器”,则会显示窗口,但是如果我修改 TextBlock 的文本,则会出现异常
例外
System.ArgumentNullException
Value cannot be null.
at System.RuntimeType.MakeGenericType(Type[] instantiation)
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()
at MS.Internal.Designer.PropertyEditing.PropertyInspector.OnSelectionChangedIdleForced(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
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)
我没有办法调试问题是什么,坦率地说,考虑到这个简单的例子应该没有任何东西应该让设计者崩溃,我感到很沮丧。有任何想法吗?
更新
重新安装更新重新加载后,问题暂时消失了。现在问题又回来了。
实际上,我不确定问题是否消失了。我还尝试了 VS 安全模式、/resetsettings,并删除了 VS 文件夹中的几个缓存文件夹。
更新2
这是一个显示问题的截屏视频,请原谅我的分辨率,我是纵向的。