microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
202 stars 6 forks source link

[BUG] Add new file failed from Solution Explorer. #500

Open alfadb opened 9 months ago

alfadb commented 9 months ago

Describe the Issue

When I create a new class from solution explorer, I got a error.

Steps To Reproduce

  1. Add new Class from Solution Explorer:
  1. Get Error: image
    
    Error running command csdevkit.addNewFile: Failed with ExitCode(103)
    Details
    No templates or subcommands found matching: 'class'.
    Did you mean one of the following templates?
    dotnet new classlib
    Did you mean one of the following subcommands?
    dotnet new list

To list installed templates similar to 'class', run: dotnet new list class To search for the templates on NuGet.org, run: dotnet new search class

For details on the exit code, refer to https://aka.ms/templating-exit-codes#103 . This is likely caused by the extension that contributes csdevkit.addNewFile.



### Expected Behavior

_No response_

### Environment Information

- Windows 11 + RemoteSSH to Archlinux
- VSCode Version: 1.82.0
- Extension Version: v0.4.10 (Last released 2023-9-8, 02:12:19)
smitpatel commented 9 months ago

This has been fixed in next release. Should be available in 0.5.*

alfadb commented 9 months ago

This has been fixed in next release. Should be available in 0.5.*

Ok, Thanks.

HUNZALAMUSHTAQ commented 6 months ago

Error running command csdevkit.addNewFile: Failed with ExitCode(6) Details No templates found matching: 'class'. To list installed templates, run: dotnet new --list To search for the templates on NuGet.org, run: dotnet new class --search . This is likely caused by the extension that contributes csdevkit.addNewFile.

Still getting this issue in VS Code C# dev kit version: v1.0.14

simon125 commented 6 months ago

Same here, I'm still getting the same error when I'm trying to create new file (Class etc)

Environment Information Ubuntu 20.04.5 LTS VSCode Version: 1.84.2 Extension Version: .NET Extension Pack v1.0.13

theekshanak commented 5 months ago

Same here, I'm getting the same error when I try to create a new file using Solution Explorer

Environment Information macOS Sonoma : 14.1.2 (23B92) VSCode version: 1.85.1 (Universal) Extension Version: v1.1.16

yoav-melamed commented 5 months ago

I'm also having the same issue.

Environment macOS Sonoma : 14.1.2 Apple M2 Pro ARM64 VSCode version: 1.85.1 Extension Version: v1.1.16

smikelson75 commented 5 months ago

I'm having the same issue when I utilize the WSL Ubuntu 20.04 but everything works just fine when I use the C# Dev Kit natively on Windows. Please fix the WSL Ubuntu.

Environment Windows 11 running Ubuntu 20.04.6 LTS via WSL VSCode: 1.85.1 Extension version: 1.2.5 (Pre-release) or 1.2.4

zhangr4 commented 5 months ago

I also have the same issue here.

Environment: Windows 11 VSCode: 1.85.1 Extension version(C# Dev Kit): v1.1.16

ErikSvaleng commented 5 months ago

I also have the same issue here.

Environment: Windows 11 VSCode: 1.85.1 Extension version(C# Dev Kit): v1.1.16

Same setup, same issue. Also same issue when I switch to the Pre-Release version. Creating folders works just fine

brandochn commented 4 months ago

I'm having the same issue

Environment: Windows 10 running Ubuntu 22.04.3 LTS via WSL2 VSCode: 1.85.1 Extension version: 1.2.7

smitpatel commented 4 months ago

Reopening the ticket. While we fixed this when using 7.0 SDK, the error code in earlier SDK was different giving rise to error.

ErikSvaleng commented 4 months ago

Same setup, same issue. Also same issue when I switch to the Pre-Release version. Creating folders works just fine

With C# Dev kit now at v.1.2.7, I no longer get this error.

uhback commented 4 months ago

I'm still having the same issue:

Error running command csdevkit.addNewFile: Failed with ExitCode(6) Details No templates found matching: 'class'. To list installed templates, run: dotnet new --list To search for the templates on NuGet.org, run: dotnet new class --search . This is likely caused by the extension that contributes csdevkit.addNewFile.

Environment:

Ludogo commented 4 months ago

i had the same issue using linux Ubuntu

I was able to solve it by : dotnet new --install Vio.Dotnet.Templates

jnomikos commented 4 months ago

dotnet new --install Vio.Dotnet.Templates

This fixed the issue for me as well

majew7 commented 4 months ago

Yes, as a workaround, this worked for me too: dotnet new --install Vio.Dotnet.Templates.

Then using "Add New File..." menus worked.

Context VSCode: 1.86.0 C#: 2.15.30 C# Dev Kit: 1.3.10

RodrigoooSC commented 2 months ago

Funcionou para mim também: dotnet new --install Vio.Dotnet.Templates.

VSCode: 1.87.1 C#: 2.22.3 Kit de desenvolvimento C#: 1.4.29

liupeng5843 commented 2 months ago

dotnet new --install Vio.Dotnet.Templates is work for macos