Buildalyzer icon indicating copy to clipboard operation
Buildalyzer copied to clipboard

Illegal characters in path in `SourceFiles` when trying to open a netstandard1.6 project

Open glitch100 opened this issue 5 years ago • 0 comments

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: image

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.

glitch100 avatar May 29 '19 09:05 glitch100