Buildalyzer
Buildalyzer copied to clipboard
Illegal characters in path in `SourceFiles` when trying to open a netstandard1.6 project
When running the following:
AnalyzerManager manager = new AnalyzerManager();
ProjectAnalyzer analyzer = manager.GetProject(projectPath);
AdhocWorkspace workspace = new AdhocWorkspace();
Project roslynProject = analyzer.AddToWorkspace(workspace);
Where:
projectPath = a .csproj targetting netstandard1.6
The commandLine arguments contain:
dotnet exec "C:\Program Files\dotnet\sdk\2.2.202\Roslyn\bincore\csc.dll" /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /nostdlib+ /errorreport:prompt /warn:4
This gets converted to:

The first entry causes a Illegal characters in Path via the Path.GetFileName call when attempting to get the SourceFiles property in the AnalyzerResult class as part of the AddToWorkspace call. I suspect this is because of the dotnet exec prefix.
Feels like the Processing of these arguments should trim a dotnet exec call, but I might be wrong and just have the incorrect setup.