Issues building Roslyn with VS Pro 14 CTP: VBCSCompiler.exe crashing

Topics: General
Jun 7, 2014 at 3:09 PM
Edited Jun 7, 2014 at 3:09 PM
I've been having issues building the latest Roslyn bits with VS Pro 14 CTP. Whether I build from within VS or using the msbuild from its developer console, VBCSCompiler.exe will crash maybe 10 times during compilation (on different projects). If I attach the debugger, I can see this exception:

System.ArgumentException was unhandled
Message: An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.CodeAnalysis.dll
Additional information: Caractères non conformes dans le chemin d'accès. (Translation: Invalid characters in path)

My local clone is in "D:\Prog\ThirdParty\Roslyn2\Src", so that's not too exotic a path. I don't have symbols for this executable so the best I can get is a stack trace:
Microsoft.CodeAnalysis.CompilerServer.ServerDispatcher.Connection.ServeConnection.AnonymousMethod__2
[Native to Managed Transition]
System.IO.Path.CheckInvalidPathChars
System.IO.Path.NormalizePath
System.IO.Path.GetFullPath
Microsoft.CodeAnalysis.RuleSetProcessor.LoadFromFile
Microsoft.CodeAnalysis.RuleSet.GetDiagnosticOptionsFromRulesetFile
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser.Parse
Microsoft.CodeAnalysis.CommonCompiler.CommonCompiler
Microsoft.CodeAnalysis.CompilerServer.VisualBasicCompilerServer.RunCompiler
Microsoft.CodeAnalysis.CompilerServer.CompilerRequestHandler.BasicCompile
Microsoft.CodeAnalysis.CompilerServer.CompilerRequestHandler.BasicCompile
Microsoft.CodeAnalysis.CompilerServer.CompilerRequestHandler.HandleRequest
Microsoft.CodeAnalysis.CompilerServer.ServerDispatcher.Connection.ServeConnection.AnonymousMethod__2
System.Threading.Tasks.Task<Microsoft.CodeAnalysis.CompilerServer.BuildResponse>.InnerInvoke
System.Threading.Tasks.Task.Execute
Also, fun fact, the character encoding of the visual studio message is differently bogus whether the crash occurs as the result of a CSC or VBC invocation:
Error   17  Le canal de communication a �t� ferm�.  D:\Prog\ThirdParty\Roslyn2\Src\Workspaces\CSharp\CSC    CSharpWorkspace
Error   8   Le canal de communication a ÚtÚ fermÚ.  D:\Prog\ThirdParty\Roslyn2\Src\Compilers\VisualBasic\Source\VBC BasicCodeAnalysis
(Translation: The communication channel was closed)

Any idea how I can go about getting this to work?
Jun 26, 2014 at 1:42 PM
I have this exact same issue (invalid characters in path) trying to build the Roslyn source with VS 14. It built fine under VS 2013. Tried both the main and CTP14 and the main branches. Tried changing the repo path to simply "D:\Roslyn". Both my Windows 8.1 and VS are en-us.
Developer
Jun 26, 2014 at 5:03 PM
Well, that's no good. I'm looking into it now.
Jun 27, 2014 at 5:39 PM
Thank you a lot. I'm really glad to read that.
I think this (and future issues) could potentially be a lot simpler to resolve if we had access to VBCSCompiler.pdb.
Developer
Jul 7, 2014 at 6:23 PM
OK -- the problem was that our compiler package was out of date for Dev14. It should be updated now and the projects should point to the new package. Let me know if that fixes your problem!
Marked as answer by angocke on 7/7/2014 at 11:23 AM
Jul 8, 2014 at 11:55 AM
Awesome, it compiles. Thank you.

I had to put a custom nuget config file in the root directory, but I have a custom nuget build system and I suppose that messed with the solution somehow.
If anyone has problem with the nuget packages not installing out of the box, post in this thread and I'll post my method of restoring them.
Jul 8, 2014 at 5:48 PM
The master branch compiles fine.
An attempt to compile the Dev14CTP1 branch still results in VBCSCompiler.exe crashing over and over.
Jul 8, 2014 at 7:46 PM
The devctp branch still references Microsoft.Net.ToolsetCompilers.0.7.4032713-beta.
One simple, seemingly working workaround is to just overwrite the files in packages\Microsoft.Net.ToolsetCompilers.0.7.4032713-beta\tools with the files from a master checkout packages\Microsoft.Net.ToolsetCompilers.0.7.4070101-beta.

I suppose updating the nuget package works too, but I haven't experimented with that.