I am trying to open a C# solution file with
Solution solutionToAnalyze = buildWorkspace.OpenSolutionAsync(pathSolution).Result;
and I get the message that I have illegal characters in the path.
If I write the path to the Console, it shows
C:\AppsDemo\CSharp\Duplicates\Duplicates.sln
and I cannot see any illegal characters. It looks perfectly fine to me.
The complete debug information is this:
This exception was originally thrown at this call stack:
System.IO.Path.LegacyNormalizePath(string, bool, int, bool)
System.IO.Path.NormalizePath(string, bool, int, bool)
System.IO.Path.GetFullPathInternal(string)
Microsoft.CodeAnalysis.MSBuild.ProjectFile.GetAbsolutePath(string)
Microsoft.CodeAnalysis.MSBuild.ProjectFile.GetOutputDirectory()
Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.CSharpCompilerInputs.CSharpCompilerInputs(Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile)
Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.GetProjectFileInfoAsync(System.Threading.CancellationToken)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(System.Threading.Tasks.Task)
...
[Call Stack Truncated]
Inner Exception 1:
ArgumentException: Illegal characters in path.
Unfortunatelly the methods on which this crashes are internal and I cannot intervene or see what cause the error.
What am I doing wrong?