我们有一个扩展,我已从VS 2015升级。 该扩展从自定义项目模板(实际上只是一个空白库项目)创建解决方案,并从数据库加载源文件。 当我尝试构建解决方案/项目VS崩溃时。
“抛出了'System.ExecutionEngineException'类型的异常。”
InnerException:“这怎么可能发生?”
我也想知道这是怎么发生的。它不会发生在VS 2015中。
我现在该怎么办?我必须在某个地方举报吗?
这是CallStack的价值所在:
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
更新
我已经重新安装了VS 2017,我在VS 2017中创建了一个新的vsix项目,并按照评论中的建议复制了代码。当我尝试构建项目/解决方案时,我仍然得到与上面相同的异常。
然后我认为我的自定义项目模板出了问题。所以我在我们的扩展中绕过了创建它的代码,并希望在实验实例中创建一个新项目,以正常方式将数据库中的文件添加到新创建的项目中,然后构建它并检查我是否得到同样的例外。
但是,我甚至无法在实验实例中创建新项目。 我得到了这个例外:
“无法加载文件或程序集”Microsoft.VisualStudio.ExtensionsExplorer.UI.Aero2,Version = 15.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一。常规异常(HRESULT异常:0x80131500) “:”Microsoft.VisualStudio.ExtensionsExplorer.UI.Aero2,Version = 15.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a“
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.
那么,为什么我不能在实验实例中创建一个新项目呢?