none
NullReferenceException within Blend designer on new project targetting .NET 3.0 RRS feed

  • Question

  • I'm trying to use Microsoft Blend for Visual Studio 2017, version 15.9.2.

    When I try and use the designer, I get a NullReferenceException:

    System.NullReferenceException
    Object reference not set to an instance of an object.
    
    Server stack trace: 
       at Microsoft.VisualStudio.DesignTools.Utility.BlendSdkHelper.GetExtensionDirectories(FrameworkName frameworkName)
       at Microsoft.VisualStudio.DesignTools.DesignerHost.HostServices.HostBlendSdkService.GetExtensionDirectories(FrameworkName frameworkName)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteHostBlendSdkService.<>c__DisplayClass4_0.<Microsoft.VisualStudio.DesignTools.DesignerContract.IHostBlendSdkService.GetExtensionDirectories>b__0(IHostBlendSdkService s)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteWrapper`1.<>c__DisplayClass6_0`1.<Invoke>b__0()
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass49_0`1.<MarshalIn>b__0()
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.Invoke(Boolean waitingInExternalCall)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.InvokeCall(Call call)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.DirectInvoke(Boolean inbound, Action action, Int32 sourceApartmentId, Int32 targetApartmentId, Int32 originId, WaitHandle aborted)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.DirectInvokeInbound(Action action, Int32 targetApartmentId)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallSynchronizationMode syncMode, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action, CallSynchronizationMode syncMode, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteWrapper`1.Invoke[T](Func`2 action, CallModality callModality)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteHostBlendSdkService.Microsoft.VisualStudio.DesignTools.DesignerContract.IHostBlendSdkService.GetExtensionDirectories(FrameworkName frameworkName)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
    
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.IHostBlendSdkService.GetExtensionDirectories(FrameworkName frameworkName)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteHostBlendSdkService.<>c__DisplayClass4_0.<Microsoft.VisualStudio.DesignTools.DesignerContract.IHostBlendSdkService.GetExtensionDirectories>b__0(IHostBlendSdkService s)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteWrapper`1.<>c__DisplayClass6_0`1.<Invoke>b__0()
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass35_0`2.<MarshalOut>b__0()
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
    
    System.NullReferenceException
    Object reference not set to an instance of an object.
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal, CancellationToken cancelToken, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CancellationToken cancelToken, CallSynchronizationMode syncMode, WaitHandle timeoutSignal, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`1 func, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteWrapper`1.Invoke[T](Func`2 action, CallModality callModality)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteHostBlendSdkService.Microsoft.VisualStudio.DesignTools.DesignerContract.IHostBlendSdkService.GetExtensionDirectories(FrameworkName frameworkName)
       at Microsoft.VisualStudio.DesignTools.XamlDesigner.Tools.Assets.AssemblyAssetAggregator.BuildGlobalProviders()
       at Microsoft.VisualStudio.DesignTools.XamlDesigner.Tools.Assets.AssemblyAssetAggregator.RegisterAssemblies()
       at Microsoft.VisualStudio.DesignTools.XamlDesigner.Tools.Assets.AssemblyAssetAggregator.OnProjectActivating()
       at Microsoft.VisualStudio.DesignTools.XamlDesigner.Tools.Assets.AssemblyAssetAggregator.SwitchProjects(IProjectContext newProject)
       at Microsoft.VisualStudio.DesignTools.XamlDesigner.Tools.Assets.AssemblyAssetAggregator.DocumentViewContext_ActiveViewChanged(Object sender, ViewChangedEventArgs e)
       at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.OnActiveViewChanged(ViewChangedEventArgs e)
       at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.SetActiveDocumentAndView(SceneView view, Item item, HostViewEventArgs e)
       at Microsoft.VisualStudio.DesignTools.Designer.DocumentViewContext.SetActiveView(SceneView view, HostViewEventArgs e)
       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()
    
    System.NullReferenceException
    Object reference not set to an instance of an object.
    
    Server stack trace: 
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalInSynchronous(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallSynchronizationMode syncMode, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action, CancellationToken cancelToken, CallSynchronizationMode syncMode, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteDesignerService.MarshalInWithCancellation[TResult](IRemoteCancellationToken remoteToken, Func`2 func, ApartmentState apartmentState)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteDesignerService.Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostProject remoteProject, IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
    
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostProject remoteProject, IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IRemoteDesignerService ds, IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass14_0.<Microsoft.VisualStudio.DesignTools.DesignerContract.IDesignerService.CreateDesigner>b__0(IRemoteDesignerService ds, RemoteCancellationToken remoteToken)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass5_0`1.<MarshalOutWithCancellation>b__0(IRemoteDesignerService ds)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass30_0`1.<MarshalOut>b__0()
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
    
    System.NullReferenceException
    Object reference not set to an instance of an object.
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal, CancellationToken cancelToken, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CancellationToken cancelToken, CallSynchronizationMode syncMode, WaitHandle timeoutSignal, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CancellationToken cancelToken, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action`1 action, CancellationToken cancelToken, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalDesignerService.MarshalOutWithCancellation[TResult](CancellationToken cancelToken, Func`3 func, ApartmentState apartmentState)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalDesignerService.Microsoft.VisualStudio.DesignTools.DesignerContract.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
       at Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)
    

    I don't believe this is caused from user code, creating a new wpf app solution targetting .NET 3.0 will show this in MainWindow.xaml.

    Creating a new wpf app with either 3.5 or 4.0 results with the designer loading correctly, however I need support for 3.0 for an older app (have to target 3.0, cannot target a newer framework).

    How can I solve this?

    I've attempted to install any components that mention blend from the Visual Studio installer. And then repaired the installation when that failed to fix my problem. I do have .NET 3.0+ installed on my machine, I can build (and see any .xaml in the designer) in Visual Studio 2017 itself.

    Wednesday, November 28, 2018 1:59 PM