解决VS2008不能加载WPF设计器的问题

无法将属性“Source”的字符串“pack://application:,,,/Microsoft.Windows.Design.Developer;component/Images/Fit_To_Window.png”转换为“System.Windows.Media.ImageSource”类型的对象。 位图颜色上下文无效。  标记文件“Microsoft.Windows.Design.Developer;component/themes/ZoomControl.xaml”中对象“ControlTemplate_11”处的错误。
   在 System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
   在 System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
   在 System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
   在 System.Windows.Markup.OptimizedTemplateContent.ParseDependencyProperty(String attribValue, Int16 attributeId, Int16 converterTypeId, DependencyProperty& dp, Object& propertyValue)
   在 System.Windows.Markup.OptimizedTemplateContent.LookForShareableRecord(BamlRecord bamlRecord, DependencyProperty& dp, Object& dpValue)
   在 System.Windows.Markup.OptimizedTemplateContent.ReadPotentiallyShareableRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.OptimizedTemplateContent.ReadRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.OptimizedTemplateContent.AddContentRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.TemplateBamlRecordReader.AddContentRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.TemplateBamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
   在 System.Windows.Markup.TemplateTreeBuilderBamlTranslator.ParseFragment()
   在 System.Windows.Markup.TreeBuilder.Parse()
   在 System.Windows.Markup.XamlTemplateSerializer.ConvertBamlToObject(BamlRecordReader reader, BamlRecord bamlRecord, ParserContext context)
   在 System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
   在 System.Windows.Markup.StyleBamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
   在 System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.StyleBamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
   在 System.Windows.Markup.StyleTreeBuilderBamlTranslator.ParseFragment()
   在 System.Windows.Markup.TreeBuilder.Parse()
   在 System.Windows.Markup.XamlStyleSerializer.ConvertBamlToObject(BamlRecordReader reader, BamlRecord bamlRecord, ParserContext context)
   在 System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
   在 System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   在 System.Windows.Markup.BamlRecordReader.ReadElement(Int64 startPosition, XamlObjectIds contextXamlObjectIds, Object dictionaryKey)
   在 System.Windows.ResourceDictionary.CreateObject(Int32 valuePosition, Object key)
   在 System.Windows.ResourceDictionary.RealizeDeferContent(Object key, Object& value, Boolean& canCache)
   在 System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
   在 System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
   在 System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
   在 System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
   在 System.Windows.ResourceDictionary.get_Item(Object key)
   在 System.Windows.DeferredResourceReference.GetValue(BaseValueSourceInternal valueSource)
   在 System.Windows.DependencyPropertyChangedEventArgs.get_NewValue()
   在 System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   在 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
   在 System.Windows.StyleHelper.ApplyTemplatedParentValue(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, DependencyProperty dp, FrameworkElementFactory templateRoot)
   在 System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot)
   在 System.Windows.StyleHelper.LoadOptimizedTemplateContent(DependencyObject container, ParserContext parserContext, OptimizedTemplateContent optimizedTemplateContent, FrameworkTemplate frameworkTemplate, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
   在 System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
   在 System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
   在 System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
   在 System.Windows.FrameworkElement.ApplyTemplate()
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   在 System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   在 System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   在 System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   在 System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 System.Windows.Controls.Control.MeasureOverride(Size constraint)
   在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   在 System.Windows.UIElement.Measure(Size availableSize)
   在 System.Windows.Interop.HwndSource.SetLayoutSize()
   在 System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   在 System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   在 MS.Internal.Designer.VSIsolatedDesigner.ViewHolder.Initialize()
   在 MS.Internal.Designer.VSIsolatedDesigner.ViewHolder..ctor(UIElement content)
   在 MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.get_ViewHandle()
   在 MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle()
   在 MS.Internal.Designer.DesignerPane.LoadDesignerView()

 
位图颜色上下文无效。
   在 MS.Internal.HRESULT.Check(Int32 hr)
   在 System.Windows.Media.ColorContextHelper.OpenColorProfile(IntPtr pProfile)
   在 System.Windows.Media.ColorContext.FromRawBytes(Byte[] data)
   在 System.Windows.Media.ColorContext.FromStream(Stream stm, String filename)
   在 System.Windows.Media.ColorContext.Initialize(Uri profileUri, Boolean isStandardProfileUriNotFromUser)
   在 System.Windows.Media.ColorContext..ctor(PixelFormat pixelFormat)
   在 System.Windows.Media.Imaging.BitmapSource.CreateCachedBitmap(BitmapFrame frame, BitmapSourceSafeMILHandle wicSource, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, BitmapPalette palette)
   在 System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation()
   在 System.Windows.Media.Imaging.BitmapFrameDecode..ctor(Int32 frameNumber, BitmapSourceSafeMILHandle sourceHandle, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, BitmapDecoder decoder)
   在 System.Windows.Media.Imaging.BitmapDecoder.SetupFrames(BitmapDecoder decoder, ReadOnlyCollection`1 frames)
   在 System.Windows.Media.Imaging.BitmapDecoder.get_Frames()
   在 System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy)
   在 System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   在 System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text)
   在 System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)

 
文本内容中发现无效字符。

 

 

发现碰到这个错误的人很少,只有在VISTA才有的问题;

http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/98d2b5c0-b45f-4157-88c6-15aa72651c33/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值