VS2008无法加载xaml设计页面的问题

发布时间:2014-10-25 2:21:12
来源:分享查询网

今天突然发现本来能正常打开的xaml设计页面无法正常打开了,页面上显示如下异常错误:  '/Microsoft.Windows.Design.Developer;component/themes/SizeFeedback.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified.  Error at object 'ResourceDictionary_2'.   at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)   at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)   at System.Windows.Markup.BamlRecordReader.ThrowException(String message, Exception innerException)   at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)   at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)   at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)   at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)   at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()   at System.Windows.Markup.TreeBuilder.Parse()   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)   at System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)   at System.Windows.SystemResources.ResourceDictionaries.LoadGenericDictionary(Boolean isTraceEnabled)   at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)   at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)   at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)   at System.Windows.FrameworkElement.UpdateThemeStyleProperty()   at System.Windows.FrameworkElement.OnInitialized(EventArgs e)   at System.Windows.FrameworkElement.TryFireInitialized()   at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)   at MS.Internal.FrameworkObject.ChangeLogicalParent(DependencyObject newParent)   at System.Windows.FrameworkElement.AddLogicalChild(Object child)   at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)   at System.Windows.Controls.UIElementCollection.Add(UIElement element)   at MS.Internal.Designer.SimpleViewManager.DesignerBackground..ctor(UIElement content)   at MS.Internal.Designer.SimpleViewManager.get_View()   at Microsoft.Windows.Design.Documents.MarkupDocumentManager.get_View()   at MS.Internal.Host.Designer.get_View()   at MS.Internal.Designer.VSDesigner.Load()   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)   at MS.Internal.Host.Isolation.IsolatedDesigner.Load()   at MS.Internal.Designer.DesignerPane.LoadDesignerView()  Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified.   at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)   at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)   at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)   at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)   at System.Reflection.CustomAttribute.GetCustomAttributes(Assembly assembly, RuntimeType caType)   at System.Reflection.Assembly.GetCustomAttributes(Type attributeType, Boolean inherit)   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)   at MS.Internal.Resources.ContentFileHelper.GetContentFiles(Assembly asm)   at MS.Internal.Resources.ContentFileHelper.IsContentFile(String partName)   at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)   at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)   at System.Windows.ResourceDictionary.set_Source(Uri value) 经确认原来是因为我把solution直接改成了另外一个名字,太囧了:)

返回顶部
查看电脑版