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
231 stars 13 forks source link

[BUG] Opening csproj: "It need be converted to new SDK style to work in C# Dev Kit." #528

Closed dibarbet closed 7 months ago

dibarbet commented 1 year ago

Describe the Issue

Copied from https://github.com/dotnet/vscode-csharp/issues/6363

Type: Bug

Issue Description

There are a number of issues when opening the project at https://github.com/fknaopen/WindowsHoGPPeripheral:

  1. The project does not do anything useful when opened.
  2. Control-clicking on the link fails because the closing quote is included in the link.
  3. The translation "It need to be converted" is incorrect -- it should say "It needs to be converted"
  4. The text is unhelpful -- what does it need to be converted to, and how can the conversion be performed?

Steps to Reproduce

  1. Clone https://github.com/fknaopen/WindowsHoGPPeripheral
  2. Open the project
  3. Select "src/bleHID/bleHID.csproj"

Expected Behavior

The project should open, or an actionable error should be presented.

Actual Behavior

The console outputs this error:

2023-09-14 22:56:35.619 [warning] The project file 'e:\Code\Ion\WindowsHoGPPeripheral\src\bleHID\bleHID.csproj' is in unsupported format (for example, a traditional .NET Framework project). It need be converted to new SDK style to work in C# Dev Kit.
2023-09-14 22:56:35.688 [error] Failed to load project 'e:\Code\Ion\WindowsHoGPPeripheral\src\bleHID\bleHID.csproj'. One or more errors occurred. (This project is not supported in C# Dev Kit.)
2023-09-14 22:56:38.488 [info] Project system initialization finished. 0 project(s) are loaded, and 1 failed to load.

Additionally, control-clicking on the .csproj file in the error log presents an error:

[Window Title]
Visual Studio Code

[Main Instruction]
Unable to open 'bleHID.csproj''

[Content]
The editor could not be opened because the file was not found.

[Create File] [Cancel]

image

Logs

C# log

Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime No compatible .NET runtime found. Minimum required version is 7.0. Dotnet path: c:\Users\Sean\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\7.0.11\dotnet.exe Activating C# + C# Dev Kit + C# IntelliCode... [Info - 10:56:29 PM] [Program]Language server initialized Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime No compatible .NET runtime found. Minimum required version is 7.0.

C# LSP Trace Logs

Extension vscode.bat does not contribute csharpExtensionLoadPaths Extension vscode.clojure does not contribute csharpExtensionLoadPaths Extension vscode.coffeescript does not contribute csharpExtensionLoadPaths Extension vscode.configuration-editing does not contribute csharpExtensionLoadPaths Extension vscode.cpp does not contribute csharpExtensionLoadPaths Extension vscode.csharp does not contribute csharpExtensionLoadPaths Extension vscode.css does not contribute csharpExtensionLoadPaths Extension vscode.css-language-features does not contribute csharpExtensionLoadPaths Extension vscode.dart does not contribute csharpExtensionLoadPaths Extension vscode.debug-auto-launch does not contribute csharpExtensionLoadPaths Extension vscode.debug-server-ready does not contribute csharpExtensionLoadPaths Extension vscode.diff does not contribute csharpExtensionLoadPaths Extension vscode.docker does not contribute csharpExtensionLoadPaths Extension vscode.emmet does not contribute csharpExtensionLoadPaths Extension vscode.extension-editing does not contribute csharpExtensionLoadPaths Extension vscode.fsharp does not contribute csharpExtensionLoadPaths Extension vscode.git does not contribute csharpExtensionLoadPaths Extension vscode.git-base does not contribute csharpExtensionLoadPaths Extension vscode.github does not contribute csharpExtensionLoadPaths Extension vscode.github-authentication does not contribute csharpExtensionLoadPaths Extension vscode.go does not contribute csharpExtensionLoadPaths Extension vscode.groovy does not contribute csharpExtensionLoadPaths Extension vscode.grunt does not contribute csharpExtensionLoadPaths Extension vscode.gulp does not contribute csharpExtensionLoadPaths Extension vscode.handlebars does not contribute csharpExtensionLoadPaths Extension vscode.hlsl does not contribute csharpExtensionLoadPaths Extension vscode.html does not contribute csharpExtensionLoadPaths Extension vscode.html-language-features does not contribute csharpExtensionLoadPaths Extension vscode.ini does not contribute csharpExtensionLoadPaths Extension vscode.ipynb does not contribute csharpExtensionLoadPaths Extension vscode.jake does not contribute csharpExtensionLoadPaths Extension vscode.java does not contribute csharpExtensionLoadPaths Extension vscode.javascript does not contribute csharpExtensionLoadPaths Extension vscode.json does not contribute csharpExtensionLoadPaths Extension vscode.json-language-features does not contribute csharpExtensionLoadPaths Extension vscode.julia does not contribute csharpExtensionLoadPaths Extension vscode.latex does not contribute csharpExtensionLoadPaths Extension vscode.less does not contribute csharpExtensionLoadPaths Extension vscode.log does not contribute csharpExtensionLoadPaths Extension vscode.lua does not contribute csharpExtensionLoadPaths Extension vscode.make does not contribute csharpExtensionLoadPaths Extension vscode.markdown does not contribute csharpExtensionLoadPaths Extension vscode.markdown-language-features does not contribute csharpExtensionLoadPaths Extension vscode.markdown-math does not contribute csharpExtensionLoadPaths Extension vscode.media-preview does not contribute csharpExtensionLoadPaths Extension vscode.merge-conflict does not contribute csharpExtensionLoadPaths Extension vscode.microsoft-authentication does not contribute csharpExtensionLoadPaths Extension ms-vscode-remote.remote-wsl-recommender does not contribute csharpExtensionLoadPaths Extension ms-vscode.js-debug does not contribute csharpExtensionLoadPaths Extension ms-vscode.js-debug-companion does not contribute csharpExtensionLoadPaths Extension ms-vscode.vscode-js-profile-table does not contribute csharpExtensionLoadPaths Extension vscode.builtin-notebook-renderers does not contribute csharpExtensionLoadPaths Extension vscode.npm does not contribute csharpExtensionLoadPaths Extension vscode.objective-c does not contribute csharpExtensionLoadPaths Extension vscode.perl does not contribute csharpExtensionLoadPaths Extension vscode.php does not contribute csharpExtensionLoadPaths Extension vscode.php-language-features does not contribute csharpExtensionLoadPaths Extension vscode.powershell does not contribute csharpExtensionLoadPaths Extension vscode.pug does not contribute csharpExtensionLoadPaths Extension vscode.python does not contribute csharpExtensionLoadPaths Extension vscode.r does not contribute csharpExtensionLoadPaths Extension vscode.razor does not contribute csharpExtensionLoadPaths Extension vscode.references-view does not contribute csharpExtensionLoadPaths Extension vscode.restructuredtext does not contribute csharpExtensionLoadPaths Extension vscode.ruby does not contribute csharpExtensionLoadPaths Extension vscode.rust does not contribute csharpExtensionLoadPaths Extension vscode.scss does not contribute csharpExtensionLoadPaths Extension vscode.search-result does not contribute csharpExtensionLoadPaths Extension vscode.shaderlab does not contribute csharpExtensionLoadPaths Extension vscode.shellscript does not contribute csharpExtensionLoadPaths Extension vscode.simple-browser does not contribute csharpExtensionLoadPaths Extension vscode.sql does not contribute csharpExtensionLoadPaths Extension vscode.swift does not contribute csharpExtensionLoadPaths Extension vscode.theme-abyss does not contribute csharpExtensionLoadPaths Extension vscode.theme-defaults does not contribute csharpExtensionLoadPaths Extension vscode.theme-kimbie-dark does not contribute csharpExtensionLoadPaths Extension vscode.theme-monokai does not contribute csharpExtensionLoadPaths Extension vscode.theme-monokai-dimmed does not contribute csharpExtensionLoadPaths Extension vscode.theme-quietlight does not contribute csharpExtensionLoadPaths Extension vscode.theme-red does not contribute csharpExtensionLoadPaths Extension vscode.vscode-theme-seti does not contribute csharpExtensionLoadPaths Extension vscode.theme-solarized-dark does not contribute csharpExtensionLoadPaths Extension vscode.theme-solarized-light does not contribute csharpExtensionLoadPaths Extension vscode.theme-tomorrow-night-blue does not contribute csharpExtensionLoadPaths Extension vscode.tunnel-forwarding does not contribute csharpExtensionLoadPaths Extension vscode.typescript does not contribute csharpExtensionLoadPaths Extension vscode.typescript-language-features does not contribute csharpExtensionLoadPaths Extension vscode.vb does not contribute csharpExtensionLoadPaths Extension vscode.xml does not contribute csharpExtensionLoadPaths Extension vscode.yaml does not contribute csharpExtensionLoadPaths Extension ban.spellright does not contribute csharpExtensionLoadPaths Extension cschlosser.doxdocgen does not contribute csharpExtensionLoadPaths Extension Dart-Code.dart-code does not contribute csharpExtensionLoadPaths Extension Dart-Code.flutter does not contribute csharpExtensionLoadPaths Extension DavidAnson.vscode-markdownlint does not contribute csharpExtensionLoadPaths Extension GitHub.copilot does not contribute csharpExtensionLoadPaths Extension jeff-hykin.better-cpp-syntax does not contribute csharpExtensionLoadPaths Extension keroc.hex-fmt does not contribute csharpExtensionLoadPaths Extension mathiasfrohlich.Kotlin does not contribute csharpExtensionLoadPaths Extension ms-dotnettools.csdevkit does not contribute csharpExtensionLoadPaths Extension ms-dotnettools.csharp does not contribute csharpExtensionLoadPaths Extension ms-dotnettools.vscode-dotnet-runtime does not contribute csharpExtensionLoadPaths Extension ms-dotnettools.vscodeintellicode-csharp does not contribute csharpExtensionLoadPaths Extension ms-python.black-formatter does not contribute csharpExtensionLoadPaths Extension ms-python.isort does not contribute csharpExtensionLoadPaths Extension ms-python.python does not contribute csharpExtensionLoadPaths Extension ms-python.vscode-pylance does not contribute csharpExtensionLoadPaths Extension ms-vscode-remote.remote-containers does not contribute csharpExtensionLoadPaths Extension ms-vscode-remote.remote-ssh does not contribute csharpExtensionLoadPaths Extension ms-vscode-remote.remote-ssh-edit does not contribute csharpExtensionLoadPaths Extension ms-vscode-remote.remote-wsl does not contribute csharpExtensionLoadPaths Extension ms-vscode.cpptools does not contribute csharpExtensionLoadPaths Extension ms-vscode.cpptools-extension-pack does not contribute csharpExtensionLoadPaths Extension ms-vscode.cpptools-themes does not contribute csharpExtensionLoadPaths Extension ms-vscode.powershell does not contribute csharpExtensionLoadPaths Extension ms-vscode.remote-explorer does not contribute csharpExtensionLoadPaths Extension mshr-h.veriloghdl does not contribute csharpExtensionLoadPaths Extension vscjava.vscode-gradle does not contribute csharpExtensionLoadPaths Extension yzhang.markdown-all-in-one does not contribute csharpExtensionLoadPaths

Environment information

VSCode version: 1.82.0 C# Extension: 2.1.2 Using OmniSharp: false

Dotnet Information Host: Version: 7.0.11 Architecture: x64 Commit: ecb34f85ec .NET SDKs installed: No SDKs were found. .NET runtimes installed: Microsoft.NETCore.App 7.0.11 [c:\Users\Sean\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\7.0.11\shared\Microsoft.NETCore.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
Visual Studio Code Extensions |Extension|Author|Version|Folder Name| |---|---|---|---| |better-cpp-syntax|jeff-hykin|1.17.2|jeff-hykin.better-cpp-syntax-1.17.2| |black-formatter|ms-python|2023.4.1|ms-python.black-formatter-2023.4.1| |copilot|GitHub|1.111.404|github.copilot-1.111.404| |cpptools|ms-vscode|1.17.5|ms-vscode.cpptools-1.17.5-win32-x64| |cpptools-extension-pack|ms-vscode|1.3.0|ms-vscode.cpptools-extension-pack-1.3.0| |cpptools-themes|ms-vscode|2.0.0|ms-vscode.cpptools-themes-2.0.0| |csdevkit|ms-dotnettools|0.4.10|ms-dotnettools.csdevkit-0.4.10-win32-x64| |csharp|ms-dotnettools|2.1.2|ms-dotnettools.csharp-2.1.2-win32-x64| |dart-code|Dart-Code|3.72.2|dart-code.dart-code-3.72.2| |doxdocgen|cschlosser|1.4.0|cschlosser.doxdocgen-1.4.0| |flutter|Dart-Code|3.72.0|dart-code.flutter-3.72.0| |hex-fmt|keroc|1.0.0|keroc.hex-fmt-1.0.0| |isort|ms-python|2023.10.1|ms-python.isort-2023.10.1| |Kotlin|mathiasfrohlich|1.7.1|mathiasfrohlich.kotlin-1.7.1| |markdown-all-in-one|yzhang|3.5.1|yzhang.markdown-all-in-one-3.5.1| |powershell|ms-vscode|2023.6.0|ms-vscode.powershell-2023.6.0| |python|ms-python|2023.16.0|ms-python.python-2023.16.0| |remote-containers|ms-vscode-remote|0.309.0|ms-vscode-remote.remote-containers-0.309.0| |remote-explorer|ms-vscode|0.4.1|ms-vscode.remote-explorer-0.4.1| |remote-ssh|ms-vscode-remote|0.106.4|ms-vscode-remote.remote-ssh-0.106.4| |remote-ssh-edit|ms-vscode-remote|0.86.0|ms-vscode-remote.remote-ssh-edit-0.86.0| |remote-wsl|ms-vscode-remote|0.81.3|ms-vscode-remote.remote-wsl-0.81.3| |spellright|ban|3.0.118|ban.spellright-3.0.118| |veriloghdl|mshr-h|1.13.0|mshr-h.veriloghdl-1.13.0| |vscode-dotnet-runtime|ms-dotnettools|1.7.2|ms-dotnettools.vscode-dotnet-runtime-1.7.2| |vscode-gradle|vscjava|3.12.7|vscjava.vscode-gradle-3.12.7| |vscode-markdownlint|DavidAnson|0.51.0|davidanson.vscode-markdownlint-0.51.0| |vscode-pylance|ms-python|2023.9.10|ms-python.vscode-pylance-2023.9.10| |vscodeintellicode-csharp|ms-dotnettools|0.1.26|ms-dotnettools.vscodeintellicode-csharp-0.1.26-win32-x64|;

Extension version: 2.1.2 VS Code version: Code 1.82.0 (8b617bd08fd9e3fc94d14adb8d358b56e3f72314, 2023-09-06T22:07:07.438Z) OS version: Windows_NT x64 10.0.22000 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900X 12-Core Processor (24 x 3693)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|127.95GB (70.33GB free)| |Process Argv|--crash-reporter-id 13ac1c0c-c21f-4bdf-adb1-aeb068388617| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 py29gd2263cf:30792227 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 vsccc:30803844 282f8724:30602487 89544117:30613380 showlangstatbar:30737416 962ge761:30835153 03d35959:30757346 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30805730 pythonnoceb:30805159 dsvsc013:30795093 dsvsc014:30804076 diffeditorv2:30821572 dsvsc015:30829745 ```

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

No response

Thaina commented 1 year ago

There are 2 problem here

1 - It seem the old project need to be converted, and I had been trying to fix it by adding <TargetFramework>net6.0</TargetFramework> to some <PropertyGroup> to fix it. Not sure this would really solve the problem

2 - The error dialog is another unrelated annoying bug. It seem C# Dev Kit report error with ' character around path argument. But vscode see the ' as valid character for path are included in the path uri for opening file. So when trying to open something.csproj it then trying to open something.csproj' which certainly not exist

Conventionally C# should use " character instead, but the worst part is this extension are not opensource and we can't fix it ourselves

Thaina commented 1 year ago

Is this project still being maintain though?

The last commit is 3 months ago from @timheuer

webreidi commented 1 year ago

@Thaina yes, this project is actively maintained, although the code for C# Dev Kit is not maintained in this project.

C# Dev Kit does not support Legacy csproj projects. We recommend using the .NET Upgrade Assistant to help with upgrading your projects to a newer version of .NET.

Until the project is updated, Solution Explorer, Test Explorer, and other features of C# Dev Kit will not be available.

Thaina commented 1 year ago

@webreidi Reason I suspect that this project are not maintained came from the problem here

2 - The error dialog is another unrelated annoying bug. It seem C# Dev Kit report error with ' character around path argument. But vscode see the ' as valid character for path are included in the path uri for opening file. So when trying to open something.csproj it then trying to open something.csproj' which certainly not exist

I can't see where this came from except from C# dev kit itself. But this is very annoying and should be common bug yet it was not fixed properly

Anyway, is it possible to have this project being opensourced too?

webreidi commented 7 months ago

Because C# Dev Kit builds on the same foundations as Visual Studio for some of its functionality, it uses the same license model as Visual Studio and thus can not be open sourced. So none of the code for the extension itself sits in this repo, but we actively monitor issues reported and are updating the extension weekly in the pre-release channel.

Closing this issue as to use the full feature-set of C# Dev Kit, you must convert to the SDK style project.