sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dotnet new command, for project templates, behaves differently between macOS and Linux (Ubuntu)

Open CartBlanche opened this issue 1 year ago • 6 comments

Describe the bug

When running the command dotnet new meadow-startkit -n MySK on macOS and Linux, it produces different behaviour, due to case sensitivity, even though they are both *nix operating systems. On macOS the created project and sln load and run without issue in both Visual Studio for Mac and VSCode for Mac. On Linux (Ubuntu) VSCode loads the created sln, but it complains that the referenced csproj does not exist, when it definitely does. For some reason when passing the -n MySK arguments, on Linux, it converts the name MySK to mysk (note: all lower case), when replacing the required fields in the templates.

To Reproduce

The code for the StartKit template I'm referring to, can be seen in this repo: https://github.com/WildernessLabs/Meadow.Sdk/tree/develop/Meadow_DotNet_SDK/Project_Templates/templates/Meadow.StartKit

You can test the behaviour on both Mac and Linux by running: dotnet new install WildernessLabs.Meadow.Template then running: dotnet new meadow-startkit -n MySK

Under Linux you will see that the generated *.Core.cspoj is referenced, inside the other projects, as, :

<ProjectReference Include="..\mysk.Core\mysk.Core.csproj" />

When it should be referenced as:

<ProjectReference Include="..\MySK.Core\MySK.Core.csproj" />

Expected behaviour

In short dotnet new should respect the casing specified after the -n argument when run on all operating systems, when replacing the specific placeholder, to avoid the case sensitivity issues.

Exceptions (if any)

NA

Further technical details

  • dotnet --info on Mac
.NET SDK:
 Version:           8.0.101
 Commit:            6eceda187b
 Workload version:  8.0.100-manifests.c4df6daf

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  14.5
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.101/

.NET workloads installed:
 Workload version: 8.0.100-manifests.c4df6daf
 [macos]
   Installation Source: SDK 8.0.100
   Manifest Version:    14.2.8053/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.macos/14.2.8053/WorkloadManifest.json
   Install Type:        FileBased

 [ios]
   Installation Source: SDK 8.0.100
   Manifest Version:    17.2.8053/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.ios/17.2.8053/WorkloadManifest.json
   Install Type:        FileBased

 [maui]
   Installation Source: SDK 8.0.100
   Manifest Version:    8.0.7/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.7/WorkloadManifest.json
   Install Type:        FileBased

Host:
  Version:      8.0.1
  Architecture: arm64
  Commit:       bf5e279d92

.NET SDKs installed:
  6.0.101 [/usr/local/share/dotnet/sdk]
  6.0.306 [/usr/local/share/dotnet/sdk]
  6.0.403 [/usr/local/share/dotnet/sdk]
  6.0.404 [/usr/local/share/dotnet/sdk]
  6.0.405 [/usr/local/share/dotnet/sdk]
  6.0.406 [/usr/local/share/dotnet/sdk]
  6.0.407 [/usr/local/share/dotnet/sdk]
  6.0.408 [/usr/local/share/dotnet/sdk]
  6.0.410 [/usr/local/share/dotnet/sdk]
  6.0.412 [/usr/local/share/dotnet/sdk]
  6.0.413 [/usr/local/share/dotnet/sdk]
  6.0.414 [/usr/local/share/dotnet/sdk]
  6.0.415 [/usr/local/share/dotnet/sdk]
  6.0.416 [/usr/local/share/dotnet/sdk]
  6.0.417 [/usr/local/share/dotnet/sdk]
  6.0.418 [/usr/local/share/dotnet/sdk]
  6.0.419 [/usr/local/share/dotnet/sdk]
  6.0.420 [/usr/local/share/dotnet/sdk]
  6.0.421 [/usr/local/share/dotnet/sdk]
  6.0.422 [/usr/local/share/dotnet/sdk]
  7.0.100 [/usr/local/share/dotnet/sdk]
  7.0.101 [/usr/local/share/dotnet/sdk]
  7.0.102 [/usr/local/share/dotnet/sdk]
  7.0.103 [/usr/local/share/dotnet/sdk]
  7.0.200 [/usr/local/share/dotnet/sdk]
  7.0.201 [/usr/local/share/dotnet/sdk]
  7.0.202 [/usr/local/share/dotnet/sdk]
  7.0.203 [/usr/local/share/dotnet/sdk]
  7.0.302 [/usr/local/share/dotnet/sdk]
  7.0.304 [/usr/local/share/dotnet/sdk]
  7.0.306 [/usr/local/share/dotnet/sdk]
  7.0.307 [/usr/local/share/dotnet/sdk]
  7.0.308 [/usr/local/share/dotnet/sdk]
  7.0.309 [/usr/local/share/dotnet/sdk]
  7.0.310 [/usr/local/share/dotnet/sdk]
  7.0.311 [/usr/local/share/dotnet/sdk]
  7.0.312 [/usr/local/share/dotnet/sdk]
  7.0.313 [/usr/local/share/dotnet/sdk]
  7.0.314 [/usr/local/share/dotnet/sdk]
  7.0.315 [/usr/local/share/dotnet/sdk]
  7.0.316 [/usr/local/share/dotnet/sdk]
  8.0.100 [/usr/local/share/dotnet/sdk]
  8.0.101 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.22 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.23 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.24 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.25 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.26 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.27 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.28 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.29 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0-rc.2.22476.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.22 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.23 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.24 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.25 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.26 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.27 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.28 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.29 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.17 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet/x64]
    registered at [/etc/dotnet/install_location_x64]

Environment variables:
  Not set

global.json file:
  Not found
  • dotnet --info on Linux (Ubuntu)
.NET SDK:
 Version:           8.0.105
 Commit:            eae90abaaf
 Workload version:  8.0.300-baseline.24224.15

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-arm64
 Base Path:   /usr/lib/dotnet/sdk/8.0.105/

.NET workloads installed:
 Workload version: 8.0.300-baseline.24224.15
There are no installed workloads to display.

Host:
  Version:      8.0.5
  Architecture: arm64
  Commit:       087e15321b

.NET SDKs installed:
  8.0.105 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found
  • IDEs on Mac

    • VS Code v1.90.1
    • VS4Mac v17.6.12 (build 410)
  • IDE on Linux (Ubuntu)

  • VS Code v1.90.1

CartBlanche avatar Jun 18 '24 10:06 CartBlanche

I tried this locally and repro'd, here are the verbose logs on my Ubuntu WSL instance:

[2024-06-18 10:52:40.521] [Debug] [Template Engine] => [Execute]: Execute started
[2024-06-18 10:52:40.608] [Debug] [Microsoft.TemplateEngine.Edge.TemplateConstraintManager] => [Execute]: Found 5 constraints factories, initializing.
[2024-06-18 10:52:40.609] [Debug] [Microsoft.TemplateEngine.Edge.TemplateConstraintManager] => [Execute]: Found 5 constraints factories, initializing.
[2024-06-18 10:52:40.637] [Debug] [MSBuildEvaluator] => [Execute]: Output directory is: /home/chethusk/code.
[2024-06-18 10:52:40.637] [Debug] [MSBuildEvaluator] => [Execute]: Project full path is: <null>.
[2024-06-18 10:52:40.641] [Debug] [MSBuildEvaluator] => [Execute]: Found project files: .
[2024-06-18 10:52:40.641] [Debug] [MSBuildEvaluator] => [Execute]: No project found.
[2024-06-18 10:52:40.647] [Debug] [Template Engine] => [Execute] => [Template from config /home/chethusk/.templateengine/packages/WildernessLabs.Meadow.Template.1.12.2.nupkg/content/templates/Meadow.StartKit/.template.config/template.json]: Template from config /home/chethusk/.templateengine/packages/WildernessLabs.Meadow.Template.1.12.2.nupkg/content/templates/Meadow.StartKit/.template.config/template.json started
[2024-06-18 10:52:40.661] [Debug] [Template Engine] => [Execute] => [Template from config /home/chethusk/.templateengine/packages/WildernessLabs.Meadow.Template.1.12.2.nupkg/content/templates/Meadow.StartKit/.template.config/template.json]: Template from config /home/chethusk/.templateengine/packages/WildernessLabs.Meadow.Template.1.12.2.nupkg/content/templates/Meadow.StartKit/.template.config/template.json finished, took 13 ms
[2024-06-18 10:52:40.661] [Debug] [Template Engine] => [Execute]: Found template 'Meadow StartKit App' (WildernessLabs.Meadow.StartKit)
[2024-06-18 10:52:40.662] [Debug] [Template Engine] => [Execute]: The template 'Meadow StartKit App' (WildernessLabs.Meadow.StartKit) has the following validation messages:
   [Info][MV006] Missing 'author'.
   [Info][MV008] Missing 'generatorVersions'.
   [Info][MV009] Missing 'precedence'.

[2024-06-18 10:52:40.662] [Debug] [Microsoft.TemplateEngine.Edge.Template.TemplateCreator] => [Execute] => [Template content generation]: Template content generation started
[2024-06-18 10:52:40.666] [Debug] [NuGetLogger] => [Execute]: Custom source https://api.nuget.org/v3/index.json is already loaded from default configuration.
[2024-06-18 10:52:40.667] [Debug] [NuGetLogger] => [Execute]: Searching for WildernessLabs.Meadow.Template in https://api.nuget.org/v3/index.json.
[2024-06-18 10:52:40.703] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}identity' was assigned to value 'MySK'.
[2024-06-18 10:52:40.703] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}safe_name' was assigned to value 'MySK'.
[2024-06-18 10:52:40.703] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}lower_safe_name' was assigned to value 'mysk'.
[2024-06-18 10:52:40.703] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}safe_namespace' was assigned to value 'MySK'.
[2024-06-18 10:52:40.704] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}lower_safe_namespace' was assigned to value 'mysk'.
[2024-06-18 10:52:40.704] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'language{-VALUE-FORMS-}identity' was assigned to value 'C#'.
[2024-06-18 10:52:40.704] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'type{-VALUE-FORMS-}identity' was assigned to value 'project'.
[2024-06-18 10:52:40.708] [Debug] [NuGetLogger] => [Execute]:   GET https://api.nuget.org/v3/registration5-gz-semver2/wildernesslabs.meadow.template/index.json
[2024-06-18 10:52:40.722] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}identity' was assigned to value 'MySK'.
[2024-06-18 10:52:40.722] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}safe_name' was assigned to value 'MySK'.
[2024-06-18 10:52:40.723] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}lower_safe_name' was assigned to value 'mysk'.
[2024-06-18 10:52:40.723] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}safe_namespace' was assigned to value 'MySK'.
[2024-06-18 10:52:40.723] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}lower_safe_namespace' was assigned to value 'mysk'.
[2024-06-18 10:52:40.723] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'language{-VALUE-FORMS-}identity' was assigned to value 'C#'.
[2024-06-18 10:52:40.723] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'type{-VALUE-FORMS-}identity' was assigned to value 'project'.
[2024-06-18 10:52:40.828] [Debug] [Microsoft.TemplateEngine.Edge.Template.TemplateCreator] => [Execute] => [Template content generation]: Template content generation finished, took 166 ms
The template "Meadow StartKit App" was created successfully.
[2024-06-18 10:52:41.093] [Debug] [NuGetLogger] => [Execute]:   OK https://api.nuget.org/v3/registration5-gz-semver2/wildernesslabs.meadow.template/index.json 384ms
[2024-06-18 10:52:41.144] [Debug] [NuGetLogger] => [Execute]: Found 22 versions for WildernessLabs.Meadow.Template in NuGet feed https://api.nuget.org/v3/index.json.
[2024-06-18 10:52:41.146] [Debug] [NuGetLogger] => [Execute]: Found 2 search endpoints.
[2024-06-18 10:52:41.146] [Debug] [NuGetLogger] => [Execute]: Querying https://azuresearch-usnc.nuget.org/query?q=WildernessLabs.Meadow.Template&skip=0&take=1&prerelease=true&semVerLevel=2.0.0

[2024-06-18 10:52:41.448] [Debug] [Template Engine] => [Execute]: Execute finished, took 927 ms

From this, it seems clear that somehow the lower_safe_name is being used for the transformations, but I don't think that's correct or valid here - the template should be using the name directly for anything related to file paths. I think this is because of the sourceName customizations in the template, but I am not sure here. If you're using the ___safeprojectname___ in more contexts than file paths, I would switch to making specific derived symbols for each of the use cases you have to prevent this kind of overlapping-semantics. We have docs on the semantics of sourceName here that may help, and those docs link to the more general 'value forms' docs here.

baronfel avatar Jun 18 '24 15:06 baronfel

@baronfel thanks for taking a look at this so quickly. I will take a look at the links you suggested in the morning, UK time.

CartBlanche avatar Jun 18 '24 22:06 CartBlanche

@baronfel Curiosity got the better of me, so I looked at the links you suggested. Now if I understand them correctly I should be able to replace: <ProjectReference Include="..\___safeprojectname___.Core\___safeprojectname___.Core.csproj" /> with <ProjectReference Include="..\$(name{-VALUE-FORMS-}identity).Core\$(name{-VALUE-FORMS-}identity).Core.csproj" /> ``

and this should give me the required case sensitivity behaviour? But this then breaks the ability to just load the ___safeprojectname___.sln solution to have a quick iterative cycle, should this whole startkit need to be changed.

So to clarify and give you some context: The reason why I moved away from using the $safeprojectname$ tag within these templates, in the 1st place, was that this did not allow me or the team, to simple load up the sln and make changes to it, build and run it.

In a previous commit, we had to

  1. have a separate sln, where changes were made,
  2. the projects were built and tested to make sure everything worked
  3. Once that was confirmed, then those changes would need to be back ported to the templates
  4. The templates would then need to be built, installed and retested to make sure they behaved like the aforementioned separate sln, which would sometimes introduce errors. Then these would have to be tracked down, re-built and tested again.

By switching to using the ___safeprojectname___ replacement tag (which itself is "safe" in IDEs), pretty much everywhere, this allows us to have just 1 sln, that works as both the template and the project/solution that could be changed, built, tested once. We then also knew the templates would behave exactly the same way, once generated. Thus reducing the possibilities of errors creeping in as well as speeding up our development process when working on this startkit template.

Is there some other way to achieve what I've mentioned above, so that when a template needs changing I can just do it in one location and everything just builds and runs and works when generated?

CartBlanche avatar Jun 18 '24 23:06 CartBlanche

Any other thoughts you might have as well @sayedihashimi ?

timheuer avatar Jun 25 '24 17:06 timheuer

@sayedihashimi, @baronfel any suggestions or any likelihood that the passed in casing from the -n parameter could be propgated throughout the command?

CartBlanche avatar Jul 02 '24 08:07 CartBlanche

@baronfel in this case is ___safeprojectname___ a special string or can it be something like ___Safeprojectname___ so that we can better pick the correct transformation?

sayedihashimi avatar Jul 02 '24 16:07 sayedihashimi

@timheuer @sayedihashimi @baronfel @marcpopMSFT Any further info, suggested workarounds on this issue? It has been about a month since I originally raised it.

CartBlanche avatar Jul 16 '24 16:07 CartBlanche

@sayedihashimi @baronfel @marcpopMSFT bump??

CartBlanche avatar Aug 06 '24 10:08 CartBlanche

Hey @CartBlanche - so sorry for the gap in responses here. I don't know any workaround off the top of my head, nor do I know what the expected behavior should be. It'll take some time to dig in an see if this is a full-on bug or if we do have some rationale or workaround for you.

However, I'm currently slammed with a whole bunch of security and release-related activities (we release 8.0.400 next week!) so I'm not sure I'll be able to get to this issue this week at all. I'll try my best to do so, though.

baronfel avatar Aug 06 '24 21:08 baronfel