Version Used:
Windows 10 Enterprise (Version 1511 Build 10586.0)
Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Steps to Reproduce:
An example project which I used to reproduce the error can be found here: Example project
Expected Behavior:
Visual Studio builds the solution showing code analysis warnings on the command-line output.
Actual Behavior:
Visual Studio crashes if code analysis is activated.
In the Windows Event Log I find the following error (sorry, it's a german windows so the log is in german but I think you can get the relevant parts):
Name der fehlerhaften Anwendung: devenv.exe, Version: 14.0.25420.1, Zeitstempel: 0x57685d85
Name des fehlerhaften Moduls: unknown, Version: 0.0.0.0, Zeitstempel: 0x00000000
Ausnahmecode: 0x80131623
Fehleroffset: 0x0f1b967e
ID des fehlerhaften Prozesses: 0x1678
Startzeit der fehlerhaften Anwendung: 0x01d23b217e265a6c
Pfad der fehlerhaften Anwendung: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Pfad des fehlerhaften Moduls: unknown
Berichtskennung: 15308bb3-3568-4fed-997d-ef36c47ebad4
Vollst盲ndiger Name des fehlerhaften Pakets:
Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
and the second error entry
Anwendung: devenv.exe
Frameworkversion: v4.0.30319
Beschreibung: Die Anwendung forderte die Beendigung des Prozesses durch System.Environment.FailFast(Zeichenfolgenmeldung) an.
Meldung: System.ArgumentException: Value does not fall within the expected range.
at Microsoft.VisualStudio.Shell.Interop.IVsRunningDocumentTable4.GetDocumentMoniker(UInt32 cookie)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.MiscellaneousFilesWorkspace.Registration_WorkspaceChanged(Object sender, EventArgs e)
at Microsoft.CodeAnalysis.WorkspaceRegistration.RaiseEvents()
at Microsoft.CodeAnalysis.Workspace.<>c__DisplayClass199_0.b__0()
at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass14_0.b__1(Task _)
at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass2_0.b__0(Task antecedent)
at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass6_01.<SafeContinueWith>b__0(Task t) Stapel: bei System.Environment.FailFast(System.String, System.Exception) bei Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception) bei Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action1)
bei Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception)
bei Roslyn.Utilities.TaskExtensions+<>c__DisplayClass6_01[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<SafeContinueWith>b__0(System.Threading.Tasks.Task) bei Microsoft.VisualStudio.Shell.Interop.IVsRunningDocumentTable4.GetDocumentMoniker(UInt32) bei Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.MiscellaneousFilesWorkspace.Registration_WorkspaceChanged(System.Object, System.EventArgs) bei Microsoft.CodeAnalysis.WorkspaceRegistration.RaiseEvents() bei Microsoft.CodeAnalysis.Workspace+<>c__DisplayClass199_0.<RegisterText>b__0() bei Roslyn.Utilities.TaskExtensions+<>c__DisplayClass14_0.<ContinueWithAfterDelay>b__1(System.Threading.Tasks.Task) bei Roslyn.Utilities.TaskExtensions+<>c__DisplayClass2_0.<SafeContinueWith>b__0(System.Threading.Tasks.Task) bei Roslyn.Utilities.TaskExtensions+<>c__DisplayClass6_01[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].b__0(System.Threading.Tasks.Task)
bei System.Threading.Tasks.ContinuationResultTaskFromTask`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
bei System.Threading.Tasks.Task.Execute()
bei System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)
bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
bei System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
bei System.Threading.Tasks.Task.ExecuteEntry(Boolean)
bei System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
bei System.Threading.ThreadPoolWorkQueue.Dispatch()
bei System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Is this the same issue we've seen before?
@Pilchie which microupdate is 14.0.25431.01 we don't seem to list it on http://versionof.net/?
@7-bit
Visual Studio crashes if code analysis is activated
Can you elaborate on what you mean by _code analysis is activated_? How are you turning it off and on?
I can't repro this on either VM by downloading this project at commit f276232
C:\CodeAnalysisError-master> devenv.com CodeAnalysisError.sln /rebuild
Microsoft Visual Studio "15" RC Version 15.0.25913.0.
Copyright (C) Microsoft Corp. All rights reserved.
The license for Visual Studio expires in 197 days.
1>------ Rebuild All started: Project: TestLib, Configuration: Debug Any CPU ------
1> TestLib -> C:\CodeAnalysisError-master\TestLib\bin\Debug\TestLib.dll
1> Running Code Analysis...
1>MSBUILD : warning CA2210: Microsoft.Design : Sign 'TestLib.dll' with a strong name key.
1>MSBUILD : warning CA1014: Microsoft.Design : Mark 'TestLib.dll' with CLSCompliant(true) because it exposes externally visible types.
1>MSBUILD : warning CA1040: Microsoft.Design : Define a custom attribute to replace 'ITest'.
1> Code Analysis Complete -- 0 error(s), 3 warning(s)
C:\CodeAnalysisError-master> devenv.com CodeAnalysisError.sln /rebuild
Microsoft Visual Studio 2015 Version 14.0.25420.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Rebuild All started: Project: TestLib, Configuration: Debug Any CPU ------
1> TestLib -> c:\Users\jmarolf\Downloads\CodeAnalysisError-master\CodeAnalysisError-master\TestLib\bin\Debug\TestLib.dll
1> Running Code Analysis...
1>MSBUILD : warning CA2210: Microsoft.Design : Sign 'TestLib.dll' with a strong name key.
Can you elaborate on what you mean by code analysis is activated? How are you turning it off and on?
I can't repro this on either VM by downloading this project at commit f276232
Sure. I mean turning it off in the project settings:

When I build the example solution from the command line I get a Visual Studio Error and the entries in the Windows Event Log

Thanks I got it after a few re-tries. Taking a look now.
@Pilchie @jasonmalinowski I've confirmed that https://github.com/dotnet/roslyn/pull/14783 fixes this issue. reccomend porting to dev15-rc2
Sounds good to me - can you prepare a PR with it?
@Pilchie will do
I've made #15299.
Glad to hear that you found a fix. Any chance to get the fix soon? I'd really like to test if it works on my machine.
@7-bit you can try the fix out by installing this vsix
@jmarolf
I couldn't install the vsix. I got a Installation Failed message.
In the install log I found this:
18.11.2016 08:39:52 - Beginning to install extension to Microsoft Visual Studio Enterprise 2015...
18.11.2016 08:39:58 - Install Error : System.Xml.XmlException: Die Eingabequelle ist nicht ordnungsgem盲脽 formatiert.
bei System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
bei System.Xml.XmlExceptionHelper.ThrowInvalidBinaryFormat(XmlDictionaryReader reader)
bei System.Xml.XmlBufferReader.ReadValue(XmlBinaryNodeType nodeType, ValueHandle value)
bei System.Xml.XmlBinaryReader.ReadNode()
bei System.Xml.XmlBinaryReader.Read()
bei System.Xml.XmlBaseReader.MoveToContent()
bei Microsoft.VisualStudio.ExtensionManager.BinaryHelper.ReadXmlElementList(BinaryReader reader)
bei Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtension.Read(BinaryReader reader, String installPath)
bei Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtensionList.ReadCachedInstalledExtension(Package cacheFile, CachedInstalledExtensionListIndexEntry indexEntry, Func`2 getAssetData)
bei Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtensionList.TryGetValueInternal(Package cacheFile, String identifier, IInstalledExtension& result)
bei Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtensionList.TryGetValue(String identifier, IInstalledExtension& result)
bei Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.PartitionedInstalledExtensionList.TryGetValue(String identifier, IInstalledExtension& result)
bei Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.CommitInstalledAndUninstalledExtensions(IEnumerable`1 installedExtensions, IEnumerable`1 uninstalledExtensions, IEnumerable`1 packComponentChanges)
bei Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.BeginInstall(IInstallableExtension installableExtension, Boolean perMachine, AsyncOperation asyncOp, Boolean enforceCertificateCheckForUpgrade)
bei Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallWorker(IInstallableExtension extension, Boolean perMachine, AsyncOperation asyncOp, Boolean enforceCertificateCheckForUpgrade)
Die Eingabequelle ist nicht ordnungsgem盲脽 formatiert.
translates to
The input source is not correctly formatted
@jmarolf @jasonmalinowski I am getting this same issue on VS 2015 Enterprise Update 3 with HP Fortify 16.11, during a command-line build (devenv.com Solution /build /debug). Below is the event log entry.
I downloaded the VSIX linked above, and looking at the manifest.json file inside, I see dependencies":{"Microsoft.VisualStudio.Component.CoreEditor":"[15.0,16.0)"}. Thus I have the follow questions:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.ArgumentException: Value does not fall within the expected range.
at Microsoft.VisualStudio.Shell.Interop.IVsRunningDocumentTable4.GetDocumentMoniker(UInt32 cookie)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.MiscellaneousFilesWorkspace.Registration_WorkspaceChanged(Object sender, EventArgs e)
at Microsoft.CodeAnalysis.WorkspaceRegistration.RaiseEvents()
at Microsoft.CodeAnalysis.Workspace.<>c__DisplayClass199_0.<RegisterText>b__0()
at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass14_0.<ContinueWithAfterDelay>b__1(Task _)
at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass2_0.<SafeContinueWith>b__0(Task antecedent)
at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass6_0`1.<SafeContinueWith>b__0(Task t)
Stack:
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>)
at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception)
at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass6_0`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<SafeContinueWith>b__0(System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Shell.Interop.IVsRunningDocumentTable4.GetDocumentMoniker(UInt32)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.MiscellaneousFilesWorkspace.Registration_WorkspaceChanged(System.Object, System.EventArgs)
at Microsoft.CodeAnalysis.WorkspaceRegistration.RaiseEvents()
at Microsoft.CodeAnalysis.Workspace+<>c__DisplayClass199_0.<RegisterText>b__0()
at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass14_0.<ContinueWithAfterDelay>b__1(System.Threading.Tasks.Task)
at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass2_0.<SafeContinueWith>b__0(System.Threading.Tasks.Task)
at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass6_0`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<SafeContinueWith>b__0(System.Threading.Tasks.Task)
at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
at System.Threading.Tasks.SynchronizationContextTaskScheduler.PostCallback(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
@nil4
is it safe to install this VSIX on VS 2015?
There is new metadata in there so this VSIX is compatible with 2017 but it should still install on 2015
how can I remove the VSIX, if it does not resolve the issue, or I run into other problems after installing it?
- Go to Extensions and Updates under tools
- Go to Installed Extensions
- Uninstall
Roslyn Language Services
@jmarolf Is there a way to uninstall the VSIX if Visual Studio doesn't open due to the VSIX? One of these previous VSIX patches hosed my VS2015 install.
Does /safemode do the trick?
Found potential solution here: https://stackoverflow.com/a/32672070/1519839
@MRatnam see steps 1-3 in the post above. Just uninstall the extension from within Visual Studio
@jmarolf As per previous comment, I was unable to open Visual Studio after installing a VSIX patch for Roslyn Language Services.
@MRatnam oh sorry, you can delete the folder under C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\14.0\Extensions and then run devenv /updateconfiguration if that SO solution does not work
@jmarolf Ah great thanks! Just testing on sandbox now.
@jmarolf Unfortunately I could not install the VSIX. Received the following:
5/05/2017 11:46:14 AM - Beginning to install extension to Microsoft Visual Studio Enterprise 2015...
5/05/2017 11:46:24 AM - Install Error : System.Xml.XmlException: The input source is not correctly formatted.
at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
at System.Xml.XmlExceptionHelper.ThrowInvalidBinaryFormat(XmlDictionaryReader reader)
at System.Xml.XmlBufferReader.ReadValue(XmlBinaryNodeType nodeType, ValueHandle value)
at System.Xml.XmlBinaryReader.ReadNode()
at System.Xml.XmlBinaryReader.Read()
at System.Xml.XmlBaseReader.MoveToContent()
at Microsoft.VisualStudio.ExtensionManager.BinaryHelper.ReadXmlElementList(BinaryReader reader)
at Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtension.Read(BinaryReader reader, String installPath)
at Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtensionList.ReadCachedInstalledExtension(Package cacheFile, CachedInstalledExtensionListIndexEntry indexEntry, Func2 getAssetData) at Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtensionList.TryGetValueInternal(Package cacheFile, String identifier, IInstalledExtension& result) at Microsoft.VisualStudio.ExtensionManager.CachedInstalledExtensionList.TryGetValue(String identifier, IInstalledExtension& result) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.PartitionedInstalledExtensionList.TryGetValue(String identifier, IInstalledExtension& result) at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.CommitInstalledAndUninstalledExtensions(IEnumerable1 installedExtensions, IEnumerable1 uninstalledExtensions, IEnumerable1 packComponentChanges)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.BeginInstall(IInstallableExtension installableExtension, Boolean perMachine, AsyncOperation asyncOp, Boolean enforceCertificateCheckForUpgrade)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallWorker(IInstallableExtension extension, Boolean perMachine, AsyncOperation asyncOp, Boolean enforceCertificateCheckForUpgrade)
After the failed VSIX installation, I am now receiving messages like this:
c:\Solution\SomeProject.csproj : error : Project 'SomeProject' could not be opened because the Visual C# 2015 compiler could not be created. Please re-install Visual Studio.
c:\Solution\SomeProject.csproj : error : The application for the project is not installed.
@MRatnam
I Had the same issue and never got help. Instead he set the state of this issue to "Closed".
After all I had to reinstall Visual Studio :(
@MRatnam @7-bit If all else fails I would try a repair instead of a reinstall
@MRatnam @7-bit Note that installing this VSIX is for validation only, I would not run it in production.
@jmarolf Tried repair and unfortunately the install was still broken with the VC# compiler issue. I had to delete my _Local_ folder from Users for Visual Studio 14.0.
Most helpful comment
@nil4
There is new metadata in there so this VSIX is compatible with 2017 but it should still install on 2015