question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`dotnet new` emits files with two periods before extension

See original GitHub issue

Describe the bug

Now that we’ve upgraded our repo requirements a la global.json to .NET 7.0.11, our dotnet new azsdkdbg now emits files with two periods before the extension e.g., “Azure.Template…csproj”, “Azure.Template…sln”, etc.

To Reproduce

  1. Shallow clone the https://github.com/Azure/azure-sdk-for-net repo:
    git clone --depth=0 https://github.com/Azure/azure-sdk-for-net.git
    
  2. Install the template:
    dotnet new install sdk/template
    
  3. Use the template:
    dotnet new azsdk -o sdk --serviceDirectory test --groupName dotnet --clientName TestClient
    

Exceptions (if any)

No exception, but show the files in the sdk/dotnet directory example tree /f and notice a number of generated files with “…extension” e.g., sdk/dotnet/test/Azure.dotnet…sln.

Further technical details

This was working under previous SDK versions. See https://github.com/Azure/azure-sdk-for-net/tree/957a870c86b61c8f698d9915812a1575874545fa/sdk/template for the current template used in this issue.

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
YuliiaKovalovacommented, Feb 2, 2023

Hi @heaths,

I took a closer look at your template and found this part causes the mentioned error: ClientNameCapitalCase references ClientName, instead of clientName specified above.

It worked in .Net 6.0 because this ref symbol parsing wasn’t case-sensitive (.ClientName vs clientName were considered equivalent) So we strongly recommend you adjust the template to the changes in .Net 7.0 because it doesn’t work as expected now.

1reaction
baronfelcommented, Jan 18, 2023

@dotnet/templating-engine-maintainers should this be moved to dotnet/templating for investigation? @JanKrivanek’s idea about the potential dependency ordering of a derived-and-used symbol seems a promising lead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Get file extension with a file that has multiple periods
However I have files in my app with multiple periods. FileInfo file = new FileInfo("c:\\scene_a.scene.xml"); MessageBox.Show(file.Extension); ...
Read more >
What's new in C# 9.0 - C# Guide
First, the changes to partial methods. Before C# 9.0, partial methods are private but can't specify an access modifier, have a void return,...
Read more >
What's new in .NET 8
The new WithAddedModifier(IJsonTypeInfoResolver, Action<JsonTypeInfo>) extension method lets you easily introduce modifications to the ...
Read more >
Should file names contain multiple periods?
Since long filenames and VFAT exist, filenames with two periods in them are perfectly valid in Windows. As far as the modern file...
Read more >
fopen - Manual
If no wrappers for that protocol are registered, PHP will emit a notice to help you track potential problems in your script and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found