Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] C# Dev Kit - Create .Net Project fails silently #1289

Open
lorenschwartz opened this issue Jul 16, 2024 · 23 comments
Open

[BUG] C# Dev Kit - Create .Net Project fails silently #1289

lorenschwartz opened this issue Jul 16, 2024 · 23 comments
Assignees
Labels
area-templates Experiences around the project/item templates bug Something isn't working

Comments

@lorenschwartz
Copy link

Describe the Issue

I am trying to create a new .Net Project using Ctrl+Shift+P >> ".NET New Project".

I see the following activity int he OUTPUT window:
Using dotnet configured on PATH
Dotnet path: /opt/homebrew/Cellar/dotnet/8.0.4/libexec/dotnet
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stdout] {"pipeName":"/var/folders/q0/0rsxznqx7qx4gh08wj8w37hw0000gn/T/7702b148.sock"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info - 5:43:18 PM] [Program] Language server initialized

And that's it... nothing else happens.

Steps To Reproduce

No response

Expected Behavior

Dialogue for selecting a dotnet template type.

Environment Information

  • OS: macOS (M2 Max)
  • VSCode: Version: 1.91.1
    Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
    Date: 2024-07-09T22:07:46.768Z (6 days ago)
    Electron: 29.4.0
    ElectronBuildId: 9728852
    Chromium: 122.0.6261.156
    Node.js: 20.9.0
    V8: 12.2.281.27-electron.0
    OS: Darwin arm64 23.5.0
@lorenschwartz lorenschwartz added the bug Something isn't working label Jul 16, 2024
@smitpatel smitpatel self-assigned this Jul 16, 2024
@smitpatel
Copy link
Member

Do you have a folder open in workspace? Do you have a solution open? If you wait for some time (it can take up some time to create template cache and start all services, if there is nothing in cache and running) after clicking ".NET> New Project" does the template list show up?

@smitpatel smitpatel added the area-templates Experiences around the project/item templates label Jul 16, 2024
@lorenschwartz
Copy link
Author

No to both. I've closed all folders and solutions. Tried quitting and restarting VSCode multiple times. Also, it's been at the same spot for over 6 hours now.

I have other MBPs (all Intel machines) with VSCode settings synched and it works fine on those machines. Not sure if that's a clue or a red herring, though.

@smitpatel
Copy link
Member

That could be issue in loading something platform specific. When it is hung can you share logs of extension?
In the VS code window with hang, use command palette to search for "Open extensions logs folder". From that folder we need content of csdevkit folder to evaluate logs.

@lorenschwartz
Copy link
Author

lorenschwartz commented Jul 17, 2024 via email

@smitpatel
Copy link
Member

smitpatel commented Jul 17, 2024

Can you share list of folders you see in the extensions logs folder? Lack of that folder indicates that C# dev kit didn't activate. Can you open some workspace which has solution file and projects and try running Add new project command in that and see if that is working? That would help us isolate that if extension itself is failing to activate in all cases or add new project is failing to activate it correctly.

@lorenschwartz
Copy link
Author

lorenschwartz commented Jul 17, 2024 via email

@smitpatel
Copy link
Member

@lorenschwartz - If you were trying to add screenshot in last post then I think, adding image via mail reply doesn't work with github. You may need to use the web UI.

@lorenschwartz
Copy link
Author

image

Thanks for the tip @smitpatel . Please find the screenshot attached here.

@smitpatel
Copy link
Member

@lifengl - C# dev kit extension is not activating on mac machine. Any suggestions how to investigate further?

@smitpatel
Copy link
Member

@lorenschwartz - Can you verify you are not running into setting which blocks extension activation as mentioned here https://code.visualstudio.com/docs/csharp/cs-dev-kit-faq#_why-isnt-c-dev-kit-activating-c-dev-kit-commands-are-not-found

@smitpatel smitpatel added the needs-more-info Needing more information, waiting on OP label Jul 31, 2024
@lorenschwartz
Copy link
Author

@smitpatel I can confirm that I am running v2.39.29, that dotnet.preferCSharpExtension is not set and that I'm not running a read only OS. I've also performed the process to isolate if other extensions are interfering in any way and none are.

Thinking out loud here, but could I copy the contents of this folder from a working computer to this one? Would that work or just make the matters worse? Thanks

Copy link

github-actions bot commented Aug 7, 2024

@smitpatel, the 'needs-more-info' label has been removed upon receiving further response from the original bug filer.

@github-actions github-actions bot removed the needs-more-info Needing more information, waiting on OP label Aug 7, 2024
@smitpatel
Copy link
Member

smitpatel commented Aug 7, 2024

No, that folder is supposed to be created when C# dev kit activates itself. It is not required for it to run. Can you share output of all the windows of C# dev kit. There are few of them created. We may be able to figure out why C# dev kit fails to activate correctly.

@smitpatel
Copy link
Member

Closing as requested information is not provided and we are unable to investigate further. We can reopen issue if we get more information to investigate.

@smitpatel smitpatel closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
@smitpatel smitpatel removed their assignment Aug 26, 2024
@lorenschwartz
Copy link
Author

Hi @smitpatel , apologies for taking forever to get back to you, but I'm unclear as to the request. How would I go about showing the output of the C# dev kit windows? When I try to use the command ".NET: New Project..." absolutely nothing happens. Nothing appears in the Problems, Output, Debug Console or Terminal.

@smitpatel smitpatel reopened this Oct 4, 2024
@smitpatel
Copy link
Member

In output window of VS Code, the drop-down menu will have output in different output channels. Whichever channel has C# dev kit in their name, output from those would be needed. In very first post you mentioned you had some output there.
Open an existing solution in VS Code. Wait for a minute or so for things activate and start and then share output from output window. Also check if extension logs have folder with csdevkit in name.

@smitpatel smitpatel added the needs-more-info Needing more information, waiting on OP label Oct 7, 2024
@smitpatel smitpatel self-assigned this Oct 9, 2024
@lorenschwartz
Copy link
Author

lorenschwartz commented Oct 15, 2024 via email

@smitpatel
Copy link
Member

@lorenschwartz In the instance where you get output like above, do you see folder with csdevkit in extension logs folder?

@lorenschwartz
Copy link
Author

Nope... no folders found for the csdevkit extension.
Image

@smitpatel
Copy link
Member

@AArnott - Any ideas how to investigate this? Looks like activation starts and we activate language server but based on missing logs, C# dev kit didn't start.

@AArnott
Copy link
Member

AArnott commented Oct 18, 2024

@smitpatel Is ".NET New Project" a C# extension command? If so, I wouldn't expect VS Code to activate the C# Dev Kit extension on its own. From the C# output window it looks like C# tries to manually activate the C# Dev Kit extension, in which case, if it fails, hopefully an exception is thrown back to C# with an explanatory message?

My only other idea is that there may be a more general output window/log to read where VS Code discloses extension activation failures.

@lorenschwartz
Copy link
Author

@smitpatel I also found the following output from the 'C# Dev Kit' output window:

#getSession: Failed to running method. Error: 'Canceled: Canceled'
#getSession: Failed to running method. Error: 'Canceled: Canceled'
#getSession: Failed to running method. Error: 'Canceled: Canceled'
Starting Spawn .NET server...
No C# project is found in the workspace.
Using preinstalled .NET runtime at "/opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/dotnet" to load Dev Kit processes.
Found installed dotnet location "/opt/homebrew/Cellar/dotnet/8.0.8_1/bin/dotnet" to load projects.
.NET server STDERR: Failed to load /opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib, error: dlopen(/opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib' (code signature in <EAEA1FAA-D2F3-3E4A-8BC1-90651ADBD7C9> '/opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib' (no such file), '/opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib' (code signature in <EAEA1FAA-D2F3-3E4A-8BC1-90651ADBD7C9> '/opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs)
The library libhostfxr.dylib was found, but loading it from /opt/homebrew/Cellar/dotnet/8.0.8_1/libexec/host/fxr/8.0.8/libhostfxr.dylib failed
  - Installing .NET prerequisites might help resolve this problem.
     https://go.microsoft.com/fwlink/?linkid=2063366

.NET server exited with 130

Not sure if this helps, but there are several errors here that I'm not seeing on my other machine where this is working fine.

@github-actions github-actions bot removed the needs-more-info Needing more information, waiting on OP label Oct 18, 2024
Copy link

@smitpatel, the 'needs-more-info' label has been removed upon receiving further response from the original bug filer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-templates Experiences around the project/item templates bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants