Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet new template generates faulty sln when hyphen is in the path #165

Open
AArnott opened this issue Feb 21, 2023 · 1 comment
Open

Comments

@AArnott
Copy link
Contributor

AArnott commented Feb 21, 2023

Describe the bug

dotnet new generated avalonia solutions are broken when the solution directory contains a hyphen.

To Reproduce

dotnet new avalonia.xplat -o avalonia-test
avalonia-test\avalonia-test.sln

This repros even without the -o switch if the current directory contains a hyphen.

The solution is full of bad relative paths to project files, so all the projects fail to load:
image

It becomes clear why this is when the created project files are compared to what's in the sln file:

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "avalonia_test", "avalonia_test\avalonia_test.csproj", "{EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}"
EndProject

Note how the hyphen in the solution directory name has been changed to the underscore character. Yet this translation did not actually happen on disk: the project directories and project filenames use a hyphen.

The generated ProjectReference items in the project files have a similar bug in using underscore instead of hyphen.

Expected behavior

The solution loads successfully in Visual Studio.
The project files use a hyphen and so do references to those projects in the sln file.

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: I don't know how to look up the version of the template. But I installed it in the last couple weeks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants