VS 2017 crashes on Build Project/Solution with VSIX

3

We have an extension that I have upgraded from VS 2015. The extension creates a solution from a custom project template (which is actually just a blank library project) and loads source files from a DB. When I try to build the solution/project VS crashes.

"Exception of type 'System.ExecutionEngineException' was thrown."

InnerException: "How can this happen?"

I'm also wondering how this can happen. It doesn't happen in VS 2015.

What do I do now? Must I report this somewhere?

Here is the CallStack for what it's worth:

Microsoft.CodeAnalysis.Features.dll!Microsoft.CodeAnalysis.Diagnostics.EngineV2.DiagnosticIncrementalAnalyzer.StateManager.CreateBuildOnlyProjectStateSet(Microsoft.CodeAnalysis.Project project)   Unknown
Microsoft.CodeAnalysis.Features.dll!Microsoft.CodeAnalysis.Diagnostics.EngineV2.DiagnosticIncrementalAnalyzer.SynchronizeWithBuildAsync(Microsoft.CodeAnalysis.Workspace workspace, System.Collections.Immutable.ImmutableDictionary<Microsoft.CodeAnalysis.ProjectId, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticData>> map) Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Microsoft.CodeAnalysis.Diagnostics.EngineV2.DiagnosticIncrementalAnalyzer.<SynchronizeWithBuildAsync>d__13>(ref Microsoft.CodeAnalysis.Diagnostics.EngineV2.DiagnosticIncrementalAnalyzer.<SynchronizeWithBuildAsync>d__13 stateMachine)  Unknown
Microsoft.CodeAnalysis.Features.dll!Microsoft.CodeAnalysis.Diagnostics.EngineV2.DiagnosticIncrementalAnalyzer.SynchronizeWithBuildAsync(Microsoft.CodeAnalysis.Workspace workspace, System.Collections.Immutable.ImmutableDictionary<Microsoft.CodeAnalysis.ProjectId, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticData>> map) Unknown
Microsoft.CodeAnalysis.Features.dll!Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerService.SynchronizeWithBuildAsync(Microsoft.CodeAnalysis.Workspace workspace, System.Collections.Immutable.ImmutableDictionary<Microsoft.CodeAnalysis.ProjectId, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticData>> diagnostics)  Unknown
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.SyncBuildErrorsAndReportAsync(Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerService diagnosticService, Microsoft.CodeAnalysis.Solution solution, System.Collections.Immutable.ImmutableDictionary<Microsoft.CodeAnalysis.ProjectId, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticData>> map) Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.<SyncBuildErrorsAndReportAsync>d__24>(ref Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.<SyncBuildErrorsAndReportAsync>d__24 stateMachine)  Unknown
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.SyncBuildErrorsAndReportAsync(Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerService diagnosticService, Microsoft.CodeAnalysis.Solution solution, System.Collections.Immutable.ImmutableDictionary<Microsoft.CodeAnalysis.ProjectId, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticData>> map) Unknown
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.OnSolutionBuild.AnonymousMethod__0()    Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.(ref Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.<>c__DisplayClass22_0.<<OnSolutionBuild>b__0>d stateMachine) Unknown
Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.TaskList.ExternalErrorDiagnosticUpdateSource.OnSolutionBuild.AnonymousMethod__0()    Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Roslyn.Utilities.SimpleTaskQueue.ScheduleTask.AnonymousMethod__1(System.Threading.Tasks.Task t)   Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Roslyn.Utilities.TaskExtensions.ContinueWithAfterDelayFromAsync.AnonymousMethod__1(System.Threading.Tasks.Task _) Unknown
mscorlib.dll!System.Threading.Tasks.ContinuationResultTaskFromTask<System.Threading.Tasks.Task>.InnerInvoke()   Unknown
mscorlib.dll!System.Threading.Tasks.Task.Execute()  Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecutionContextCallback(object obj)   Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot)    Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) Unknown
mscorlib.dll!System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Unknown
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()    Unknown
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Unknown
[Native to Managed Transition]  
kernel32.dll!@BaseThreadInitThunk@12()  Unknown
ntdll.dll!__RtlUserThreadStart()    Unknown
ntdll.dll!__RtlUserThreadStart@8()  Unknown

UPDATE

I have re-installed VS 2017, I have created a new vsix project in VS 2017 and copied the code across as suggested in the comments. I still get the same exception as above when I try to Build the project/solution.

Then I thought that something was wrong with my custom project template. So I bypassed the code in our extension where that is created, and hoped to create a new project in the experimental instance, add the files from the database to the newly created project in the normal way, and then build it and check whether I get the same exception.

BUT, I can't even create a new project in the experimental instance. I get this exception:

"Could not load file or assembly 'Microsoft.VisualStudio.ExtensionsExplorer.UI.Aero2, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)":"Microsoft.VisualStudio.ExtensionsExplorer.UI.Aero2, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

The CallStack:

>   PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)   Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri) Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream)    Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Application.LoadComponent(object component, System.Uri resourceLocator)    Unknown Symbols loaded.
Microsoft.VisualStudio.ExtensionsExplorer.UI.dll!Microsoft.VisualStudio.ExtensionsExplorer.UI.VSExtensionsExplorerCtl.InitializeComponent() Unknown Symbols loaded.
Microsoft.VisualStudio.ExtensionsExplorer.UI.dll!Microsoft.VisualStudio.ExtensionsExplorer.UI.VSExtensionsExplorerCtl.VSExtensionsExplorerCtl() Unknown Symbols loaded.
[Native to Managed Transition]      Annotated Frame
[Managed to Native Transition]      Annotated Frame
mscorlib.dll!System.RuntimeType.CreateInstanceSlow(bool publicOnly, bool skipCheckThis, bool fillCache, ref System.Threading.StackCrawlMark stackMark)  Unknown Symbols loaded.
mscorlib.dll!System.Activator.CreateInstance(System.Type type, bool nonPublic)  Unknown Symbols loaded.
mscorlib.dll!System.RuntimeType.CreateInstanceImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, ref System.Threading.StackCrawlMark stackMark)  Unknown Symbols loaded.
mscorlib.dll!System.Activator.CreateInstance(System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes) Unknown Symbols loaded.
mscorlib.dll!System.Activator.CreateInstance(System.Type type, object[] args)   Unknown Symbols loaded.
System.Xaml.dll!System.Xaml.Schema.SafeReflectionInvoker.CreateInstanceCritical(System.Type type, object[] arguments)   Unknown Symbols loaded.
System.Xaml.dll!System.Xaml.Schema.SafeReflectionInvoker.CreateInstance(System.Type type, object[] arguments)   Unknown Symbols loaded.
System.Xaml.dll!System.Xaml.Schema.XamlTypeInvoker.CreateInstance(object[] arguments)   Unknown Symbols loaded.
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstanceWithCtor(System.Xaml.XamlType xamlType, object[] args)  Unknown Symbols loaded.
System.Xaml.dll!MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(System.Xaml.XamlType xamlType, object[] args)  Unknown Symbols loaded.
System.Xaml.dll!MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateInstance(System.Xaml.XamlType xamlType, object[] args)   Unknown Symbols loaded.
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(MS.Internal.Xaml.Context.ObjectWriterContext ctx)   Unknown Symbols loaded.
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteStartMember(System.Xaml.XamlMember property)  Unknown Symbols loaded.
System.Xaml.dll!System.Xaml.XamlWriter.WriteNode(System.Xaml.XamlReader reader) Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.TransformNodes(System.Xaml.XamlReader xamlReader, System.Xaml.XamlObjectWriter xamlWriter, bool onlyLoadOneNode, bool skipJournaledProperties, bool shouldPassLineNumberInfo, System.Xaml.IXamlLineInfo xamlLineInfo, System.Xaml.IXamlLineInfoConsumer xamlLineInfoConsumer, MS.Internal.Xaml.Context.XamlContextStack<System.Windows.Markup.WpfXamlFrame> stack, System.Windows.Markup.IStyleConnector styleConnector)  Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri)   Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri) Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream)    Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Application.LoadComponent(object component, System.Uri resourceLocator)    Unknown Symbols loaded.
Microsoft.VisualStudio.Dialogs.dll!Microsoft.VisualStudio.Dialogs.NewProjectDialog.InitializeComponent()    Unknown Symbols loaded.
Microsoft.VisualStudio.Dialogs.dll!Microsoft.VisualStudio.Dialogs.NewProjectDialog.NewProjectDialog(Microsoft.Internal.VisualStudio.Shell.Interop.VSNEWPROJECTDLGINFO dialogInformation, System.IServiceProvider serviceProvider, Microsoft.VisualStudio.Dialogs.NewProjectDialog.SessionState session, Microsoft.VisualStudio.Telemetry.TelemetryScope<Microsoft.VisualStudio.Telemetry.UserTaskEvent> userTask)   Unknown Symbols loaded.
Microsoft.VisualStudio.Dialogs.dll!Microsoft.VisualStudio.Dialogs.SVsDialogService.InvokeDialog(Microsoft.Internal.VisualStudio.Shell.Interop.VSNEWPROJECTDLGINFO dlgInfo, out string bstrLocation) Unknown Symbols loaded.
[Native to Managed Transition]      Annotated Frame
msenv.dll!InvokeNewProjectDlg(int,unsigned short const *,unsigned short const *,unsigned short const *,unsigned short const *,unsigned short const *,unsigned long,struct IVsBrowseProjectLocation *)   Unknown Symbols loaded.
msenv.dll!HandleNewProjectCommand(unsigned long,unsigned long,struct tagVARIANT *,struct tagVARIANT *)  Unknown Symbols loaded.
msenv.dll!HrShellExec(struct _GUID const *,unsigned long,unsigned long,struct tagVARIANT *,struct tagVARIANT *) Unknown Symbols loaded.
msenv.dll!CVSCommandTarget::ExecCmd(class CIcmdGuidCmdId const *,struct _GUID const *,unsigned long,unsigned long,struct tagVARIANT *,struct tagVARIANT *,struct _GUID *)   Unknown Symbols loaded.
msenv.dll!`anonymous namespace'::ExecForController()    Unknown Symbols loaded.
msenv.dll!CSurfaceCommandingSupport::ExecuteForController(struct CommandUI::Models::IControllerRoot const *,unsigned long,struct tagVARIANT *,struct tagVARIANT *,struct _GUID *)   Unknown Symbols loaded.
msenv.dll!CExecuteVisitor::VisitButtonController(struct CommandUI::Models::IButtonController *,struct tagVARIANT const *,struct tagVARIANT *)   Unknown Symbols loaded.
msenv.dll!CControllerVisitorBase::DispatchVisit(struct CommandUI::Models::IControllerRoot *,struct tagVARIANT const *,struct tagVARIANT *)  Unknown Symbols loaded.
msenv.dll!CControllerVisitorBase::VisitController(struct CommandUI::Models::IControllerRoot *,struct tagVARIANT const *,struct tagVARIANT *)    Unknown Symbols loaded.
msenv.dll!CSurfaceCommandingSupport::Execute(struct CommandUI::Models::IControllerRoot *,struct tagVARIANT const *,struct tagVARIANT *) Unknown Symbols loaded.
msenv.dll!CommandUI::Models::Impl::CExecutableCommandElementDataSource::Execute(struct tagVARIANT const &,struct tagVARIANT *)  Unknown Symbols loaded.
msenv.dll!CommandUI::Models::Impl::CExecutableCommandElementDataSource::ExecuteVerbHandler(struct IVsUIDispatch *,unsigned short const *,struct tagVARIANT const &,struct tagVARIANT *) Unknown Symbols loaded.
msenv.dll!Gel::CDataSource::Invoke(unsigned short const *,struct tagVARIANT,struct tagVARIANT *)    Unknown Symbols loaded.
[Managed to Native Transition]      Annotated Frame
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.Internal.VisualStudio.PlatformUI.DataSource.Invoke(string verb, object pvaIn, out object pvaOut)    Unknown Symbols loaded.
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.PlatformUI.VsCommand.Execute(object parameter)  Unknown Symbols loaded.
PresentationFramework.dll!MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource commandSource, bool userInitiated)   Unknown Symbols loaded.
PresentationFramework.dll!System.Windows.Controls.MenuItem.InvokeClickAfterRender(object arg)   Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)  Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()   Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state)  Unknown Symbols loaded.
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(object obj)   Unknown Symbols loaded.
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown Symbols loaded.
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown Symbols loaded.
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown Symbols loaded.
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state)  Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke()   Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue()  Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)  Unknown Symbols loaded.
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown Symbols loaded.
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)  Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown Symbols loaded.
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)   Unknown Symbols loaded.
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)  Unknown Symbols loaded.
[Native to Managed Transition]      Annotated Frame
user32.dll!__InternalCallWinProc@20()   Unknown Symbols loaded.
user32.dll!UserCallWinProcCheckWow()    Unknown Symbols loaded.
user32.dll!DispatchMessageWorker()  Unknown Symbols loaded.
user32.dll!_DispatchMessageW@4()    Unknown Symbols loaded.
msenv.dll!MainMessageLoop::ProcessMessage(struct IMsoStdComponentMgr *,struct IVsWindowManager *,struct tagMSG &)   Unknown Symbols loaded.
msenv.dll!CMsoCMHandler::EnvironmentMsgLoop(void)   Unknown Symbols loaded.
msenv.dll!CMsoCMHandler::FPushMessageLoop(unsigned long)    Unknown Symbols loaded.
msenv.dll!SCM::FPushMessageLoop(class SCMI *,unsigned long,void *)  Unknown Symbols loaded.
msenv.dll!SCM_MsoCompMgr::FPushMessageLoop(unsigned long,unsigned long,void *)  Unknown Symbols loaded.
msenv.dll!CMsoComponent::PushMsgLoop(unsigned long) Unknown Symbols loaded.
msenv.dll!VStudioMainLogged(void)   Unknown Symbols loaded.
msenv.dll!_VStudioMain()    Unknown Symbols loaded.
devenv.exe!util_CallVsMain(struct MAINPARAM *,int *)    Unknown Symbols loaded.
devenv.exe!CDevEnvAppId::Run(unsigned short *,int)  Unknown Symbols loaded.
devenv.exe!_WinMain@16()    Unknown Symbols loaded.
devenv.exe!util_FormRootKeyPath(unsigned short const *,unsigned short const *,unsigned short const *,unsigned short * *)    Unknown Symbols loaded.
kernel32.dll!@BaseThreadInitThunk@12()  Unknown Symbols loaded.
ntdll.dll!__RtlUserThreadStart()    Unknown Symbols loaded.
ntdll.dll!__RtlUserThreadStart@8()  Unknown Symbols loaded.

So, why can't I create a new project in the experimental instance?

c#
visual-studio-2017
visual-studio-extensions
vsix
asked on Stack Overflow Sep 6, 2017 by Igavshne • edited Oct 12, 2017 by Igavshne

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0