none
Problemas com XAML Designer (WPF) - Visual Studio 2015 Community RRS feed

  • Pergunta

  • Bom dia a todos,

    Recentemente instalei o Visual Studio 2015 Community Edition, e estou portando minha framework (WPF Custom Control Library) do .NET 4.5 (VS 2012) para .NET 4.6 (VS 2015). Tudo funcionava bem no VS 2012 c/ .NET 4.5, porém agora estou tendo problemas de NullReferenceException no XAML Designer do VS 2015 ao qual coloquei o trace ao final desta postagem.

    Abrindo o mesmo projeto no Blend para VS 2015, tudo funciona normal, ocorre apenas no Visual Studio. Já fiz vários testes, removendo alguns controles do projeto, inserindo verificações se o controle está em tempo de Design ou não, reinserindo, recompilando, abri e fechei o VS várias vezes, mas ainda não consegui detectar o ponto.

    NOTA: Em runtime também funciona normal. Quando esta exceção ocorre, o processo "Microsoft Visual Studio XAML Designer" é encerrado na lista de processos do Windows. Clicando em reload caio no mesmo problema. Se ocorresse no Blend também, até ficaria mais conformado, mas é só no VS.

    Grato.

    Trace do erro:

    System.NullReferenceException

    Object reference not set to an instance of an object.

    at Microsoft.VisualStudio.DesignTools.Platform.Utility.DocumentContext.CreateNode(ITypeId typeId) at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseCompositeElement(XamlParserContext parserContext, IDocumentNodeReference nodeReference, IType typeId, XmlElementReference xmlElementReference, XmlElement xmlElement)
    at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseElementContent(XamlParserContext parserContext, IDocumentNodeReference nodeReference, IType typeId, XmlElementReference xmlElementReference, XmlElement xmlElement)
    at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseElement(XamlParserContext parserContext, IDocumentNodeReference nodeReference, XmlElementReference xmlElementReference, XmlElement xmlElement, DocumentNode& node)
    at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseContent(XamlParserContext parserContext, IDocumentNodeReference nodeReference, XmlElementReference xmlElementReference, XmlElement xmlElement, IProperty childProperty, TypeConverter textTypeConverter, ITypeId textType, PropertyHandling propertyHandling) at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.AddPropertiesAndChildren(XamlParserContext parserContext, DocumentCompositeNodeReference nodeReference, XmlElementReference xmlElementReference, XmlElement xmlElement, Predicate`1 propertyFilter) at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.AddPropertiesAndChildren(XamlParserContext parserContext, DocumentCompositeNodeReference nodeReference, XmlElementReference xmlElementReference, XmlElement xmlElement)
    at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseCompositeElement(XamlParserContext parserContext, IDocumentNodeReference nodeReference, IType typeId, XmlElementReference xmlElementReference, XmlElement xmlElement)
    at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseElementContent(XamlParserContext parserContext, IDocumentNodeReference nodeReference, IType typeId, XmlElementReference xmlElementReference, XmlElement xmlElement)
    at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseRootElement(XamlParserContext parserContext, XmlElementReference xmlElementReference, XmlElement xmlElement) at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.Parse(XamlParserContext parserContext, XmlDocumentReference xmlDocumentReference, XmlDocument xmlDocument) at Microsoft.VisualStudio.DesignTools.Markup.XamlParser.ParseInternal(XamlParserContext parserContext) at Microsoft.VisualStudio.DesignTools.Markup.XamlLanguageService.ParseDocument(CancellationToken cancelToken) at Microsoft.VisualStudio.DesignTools.Markup.MarkupDocument..ctor(IDocumentContext documentContext, ITypeId expectedRootType, ITextBuffer textBuffer, Encoding documentEncoding, IMarkupLanguageService languageService, CancellationToken cancelToken)
    at Microsoft.VisualStudio.DesignTools.Designer.Documents.SceneMarkupDocument..ctor(IDocumentContext documentContext, IUndoService undoService, ITypeId expectedRootType, ITextBuffer textBuffer, Encoding documentEncoding, IMarkupLanguageService languageService, CancellationToken cancelToken) at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.CreateMarkupDocument(ISourceItemContext sourceItem, IHostTextBuffer textBuffer, Encoding encoding, CancellationToken cancelToken)
    at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.CreateDocument(ISourceItemContext sourceItem, CancellationToken cancelToken, Boolean isReadOnly, Boolean cloneBufferToStandalone, Boolean suppressUI, SceneDocument originalSceneDocument)
    at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.OpenDocument(ISourceItemContext sourceItem, CancellationToken cancelToken, Boolean isReadOnly, Boolean suppressUI) at Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectContextBase.OpenProjectDocument(ISourceItemContext sourceItem, Boolean suppressUI) at Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectContextBase.OpenDocument(String path, Boolean suppressUI)
    at Microsoft.VisualStudio.DesignTools.Designer.UI.ResourcePane.ResourceDictionaryContentProvider.set_ProjectDocument(IProjectDocument value) at Microsoft.VisualStudio.DesignTools.Designer.UI.ResourcePane.ResourceManager.GetContentProviderForResourceDictionary(IProjectDocument projectDocument) at Microsoft.VisualStudio.DesignTools.Designer.UI.ResourcePane.DocumentResourceContainer..ctor(ResourceManager manager, IProjectDocument document) at Microsoft.VisualStudio.DesignTools.Designer.UI.ResourcePane.ResourceManager.AddDocument(IProjectDocument projectDocument) at Microsoft.VisualStudio.DesignTools.Designer.UI.ResourcePane.ResourceManager.SetTargetProjectContexts(IProjectContext[] newProjectContexts) at Microsoft.VisualStudio.DesignTools.Designer.UI.ResourcePane.ResourceManager.DocumentViewContext_ViewOpened(Object sender, ViewEventArgs e) at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.OnViewOpened(ViewEventArgs e)
    at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.OpenViewWorker(SceneView sceneView, Boolean ensureHostOpen)
    at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.CreateAndOpenViewInternal(SceneDocument document, CancellationToken cancelToken, Boolean activate, Boolean ensureOpenInHost) at Microsoft.VisualStudio.DesignTools.Designer.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
    at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass12_0.<Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__0(CancellationToken cancelToken) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass6_0`1.<MarshalInWithCancellation>b__0() at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()


    Henrique Clausing


    • Editado Henrique Clausing segunda-feira, 26 de outubro de 2015 12:48 duplicidade de trace
    segunda-feira, 26 de outubro de 2015 12:42