RicoSuter / DNT

DNT (DotNetTools): Command line tools to manage .NET projects and solutions.
MIT License
416 stars 63 forks source link

problem with special characters in solution name and/or path #109

Closed tomdewilde closed 2 years ago

tomdewilde commented 2 years ago

I have this project where a µ is in solution name and path. The switcher.json file shows the characters ok

{
  "solution": "µCliMat.Expert.sln",
  "mappings": {
    "c8.IO": "../../c8.core/c8.core-dotnet/src/c8.IO/c8.IO.csproj",
    "c8.Security": "../../c8.core/c8.core-dotnet/src/c8.Security/c8.Security.csproj",
    "c8.Updater": "../../c8.core/c8.core-dotnet/src/c8.Updater/c8.Updater.csproj"
  },
  "removeProjects": true
}

but when running DNT to switch to the project I get this error:

DNT (DotNetTools, https://github.com/RSuter/DNT, v1.7.0.0)
Binary: C:\Users\tomdw\.dotnet\tools\.store\dnt\1.7.0\dnt\1.7.0\tools\net6.0\any\dnt.dll

Microsoft.Build.Exceptions.InvalidProjectFileException: The project file could not be loaded. Could not find file 'D:\Git.Planio\c8.æclimat\æCliMat.Expert\?CliMat.Expert.sln'.  D:\Git.Planio\c8.æclimat\æCliMat.Expert\?CliMat.Expert.sln
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, BuildEventFileInfo projectFile, String resourceName, Object[] args)
   at Microsoft.Build.Construction.SolutionFile.ParseSolutionFile()
...

notice how the 'µ' in the folder name is shown as 'æ', where as the 'µ' in the solution name is show as '?'

Thanks for any help

tomdewilde commented 2 years ago

saving the switcher.json file using utf-8 encoding solves this issue