ardalis/CleanArchitecture

Solution can't load if hypen is used in the name

dannythunder opened this issue · 6 comments

  • .NET SDK Version:
    net6

Template version: Latest of todays date (8 June 2021)

Steps to Reproduce:

  1. Install template via terminal/cmd
  2. Create new project with hyphen ( - ) i.e. my-service

Project fails to load due to some naming in the .sln gets named my_service (underscore instead of hyphen)

edit: found that this is reported as a bug (and it's been a while):
Dash - in sourceName gets changed to underscore _ inside files but not in file names

That's unfortunate, but doesn't sound like anything in my control. Probably best to document it in the README. I'll take care of it soon.

Documented in README.

+1 I ran into this issue today. Took me a few minutes scratching my head to figure out why none of the projects in my solution were loading correctly. Maybe see if you can merge that PR from a year ago. Hyphens are ubiquitous in file/project naming.

I think I ran into this whole streaming recently, too. Will prioritize it.

I realize this is a closed issue, but I wanted to add more detail for googs and bings

  • .NET SDK Version: 8.0

Steps to Reproduce:

  1. run dotnet new install Ardalis.CleanArchitecture.Template::9.0.0-preview2
  2. run dotnet new clean-arch -n clean-arch
  3. run start .\clean-arch2\clean-arch2.sln

The project paths in the sln file are generated with underscores, but the path on disk has hyphens.

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31815.197
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{106AE906-5075-410A-B941-912F811848EE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B31B4797-1D9F-4288-808C-BE9A31A98C7D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "clean_arch2.Web", "src\clean_arch2.Web\clean_arch2.Web.csproj", "{C9751CB7-4CD6-4633-A99A-4F6ADD525437}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "clean_arch2.Core", "src\clean_arch2.Core\clean_arch2.Core.csproj", "{4548EB20-1D1B-477B-AF6E-DD55653A6583}"
EndProject

Noted that the README still links to this issue. Also seeing Gonkers comment above.

See also: this issue in dotnet templating