我仍然無法讓我的設置正常工作。它正在工作,現在突然它沒有。是的,我卸載了Silverlight 5 RC,並安裝了Silverlight 5(如果有問題的話)。Visual Studio給我XAML設計師的問題
Silverlight 4 + PRISM解決方案 我有我的自定義控件的「infrastructure」項目。我有generic.xaml
這些控件的樣式。我知道問題是與我的自定義控件,因爲當我評論它 - 它的作品。有時我打開視圖並看到它,但我的自定義控件顯示爲矩形。
當我嘗試通過從工具欄拖動砸查看我的控制:
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
at MS.Internal.XcpImports.Collection_Add[T](PresentationFrameworkCollection`1 collection, Object value)
at System.Windows.PresentationFrameworkCollection`1.AddImpl(Object value)
at System.Windows.PresentationFrameworkCollection`1.System.Collections.IList.Add(Object value)
at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.InstantiateChildren(IInstanceBuilderContext context, ViewNode viewNode, DocumentCompositeNode compositeNode, Boolean isNewInstance)
當它在視圖(編輯XAML等)失敗 - 我得到這樣的:
System.Runtime.Serialization.SerializationException
Type 'System.Windows.Markup.XamlParseException' in assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is not marked as serializable.
at MS.Internal.Designer.VSDesignerClient.RestoreSelection(List`1 offsetsInXamlFile)
at MS.Internal.Designer.DesignerPane.LoadDesignerView(Boolean isReload)
一切正常偉大的在運行時,它在Blend工作很好(我解決了這個混合問題:ExpressionBlend exception when UserControl contains my custom control和這個:How to properly organize XAML resources in Silverlight?)
我浪費噸的時間已經在這..它也是o在我的測試項目中VS能夠正常工作,但我沒有太多 - 只是測試視圖和對基礎設施的參考。我希望有某種方式來調試Visual Studio ..
編輯 調試VS.得到這個第一:
at Microsoft.Windows.Design.Platform.SilverlightViewProducer.OnUnhandledException(Object sender, ViewUnhandledExceptionEventArgs e)
at Microsoft.Windows.Design.Platform.SilverlightViewProducer.OnViewUpdated()
at Microsoft.Windows.Design.Platform.ViewProducerBase.<get_DesignModeValueProviderService>b__7(IInstanceBuilderContext invokingContext)
at MS.Internal.Services.DesignModeValueProviderService.ValueTranslationServicePropertyInvalidated(Object sender, PropertyInvalidatedEventArgs e)
at MS.Internal.Features.DesignModeValueProviderConnector.ValueTranslationServiceImpl.InvalidateProperty(ModelItem item, PropertyIdentifier property)
at MS.Internal.FrameworkElementControl.FrameworkElementDesignTimePropertiesAdorner.SetDesignResizeMode(Boolean updateView)
at MS.Internal.FrameworkElementControl.FrameworkElementDesignTimePropertiesAdorner..ctor(ModelItem item)
at MS.Internal.FrameworkElementControl.FrameworkElementDesignTimePropertiesGrabHandleAdornerProvider.Activate(ModelItem item)
at Microsoft.Windows.Design.Interaction.AdornerProvider.InvokeActivate(EditingContext context, ModelItem item)
at MS.Internal.Features.AdornerProviderFeatureConnector.FeatureProvidersAdded(ModelItem item, IEnumerable`1 extensions)
at Microsoft.Windows.Design.Policies.PolicyDrivenFeatureConnector`1.OnPolicyItemsChanged(Object sender, PolicyItemsChangedEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Microsoft.Windows.Design.Policies.ItemPolicy.OnPolicyItemsChanged(PolicyItemsChangedEventArgs e)
at MS.Internal.Policies.SoleSelectionPolicy.RaisePolicyItemsChanged(ModelItem oldSoleSelection, ModelItem newSoleSelection)
at MS.Internal.Policies.SoleSelectionPolicy.OnSelectionChanged(Selection newSelection)
at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item)
at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item)
at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item)
at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value)
at MS.Internal.Designer.VSDesigner.VSDesignerClientImpl.RestoreSelection(List`1 selectionOffsetsInXamlFile)
隨着內部異常:
{「[Parser_SetValue_Exception] \ r \ nArguments: System.Windows.FrameworkElement.Style \ r \ nDebugging資源字符串 不可用常關鍵和參數提供足夠的 的信息來診斷問題,請參見 http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.60831.0&File=System.Windows.dll&Key=Parser_SetValue_Exception 。[行:0位置:0]「}
at MS.Internal.XcpImports.CreateFromXaml(UnmanagedMemoryStream stream, String sourceAssemblyName, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers)
at System.Windows.Controls.Control.GetBuiltInStyle(IntPtr nativeTarget, IntPtr& nativeStyle)
如果你有混合,然後混合打開它。此外,在VS中打開相同的解決方案,並將調試器附加到Blend,看看造成問題的原因。我還沒有嘗試過使用這兩個VS實例。但是,你可以試試看。 – 2011-12-15 04:15:25