Skip to content

Dash - in sourceName gets changed to underscore _ inside files but not in file names #1168

@livarcocc

Description

@livarcocc

From @petrroll on July 28, 2017 9:41

Steps to reproduce

  1. dotnet new -i "Peachpie.Templates::*" (template's config on GitHub)
  2. dotnet new peachpie-web -n tst-tst // specifies a sourceName that gets replaced
  3. dotnet restore

It should be reproducible with any template, didn't have time to find any other that uses sourceName both in files and filenames, though.

Expected behavior

The original sourceName gets replaced either with tst-tst or tst_tst everywhere, i.e. both in the source files (including the .sln) and in file names (e.g. names of the .msbuildproj or folders).

Actual behavior

The original sourceName gets replaced with tst_tst inside source files (e.g. in the .sln file or the server's Program.cs) but with tst-tst in file and folder names.

The mismatch between paths expected by the .sln file (it expects the projects in tst_tst.Server and tst_tst folders while they actually are in tst-tst.Server and tst-tst folders) breaks the .sln file and thus the template's build.

Environment data

dotnet --info output:

Tested on both .NET SDK 1.0.4 on Windows and on .NET SDK 2.0 preview-2 on Ubuntu via WSL.

.NET Command Line Tools (2.0.0-preview2-006497)

Product Information:
 Version:            2.0.0-preview2-006497
 Commit SHA-1 hash:  06a2093335

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/2.0.0-preview2-006497/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview2-25407-01
  Build    : 40c565230930ead58a50719c0ec799df77bddee9
.NET Command Line Tools (1.0.4)

Product Information:
 Version:            1.0.4
 Commit SHA-1 hash:  af1e6684fd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.4

Copied from original issue: dotnet/cli#7307

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions