Skip to content

LibraryImport error with Roslyn server in 2.0 #5999

Closed
dotnet/roslyn
#70331
@IrishBruse

Description

@IrishBruse

Type: Bug

Issue Description

The new 2.0 release added a new language server which has a bug when using Library Import

Steps to Reproduce

Make a source generated library import eg

    [LibraryImport("msvcrt", EntryPoint = "vsnprintf")]
    private static partial int vsnprintf(IntPtr buffer, int size, IntPtr format, IntPtr args);

Expected Behavior

No errors about partial and unused parameters

Actual Behavior

Partial method 'Raylib.vsnprintf(nint, int, nint, nint)' must have an implementation part because it has accessibility modifiers. Roslyn CS8795

Logs

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

Environment information

VSCode version: 1.80.2
C# Extension: 2.0.320
Using OmniSharp: false

Dotnet Information

Host:
Version: 7.0.9
Architecture: x64
Commit: 8e9a17b221

.NET SDKs installed:
No SDKs were found.

.NET runtimes installed:
Microsoft.NETCore.App 7.0.9 [c:\Users\Econn\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime.dotnet\7.0.9\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
advanced-new-file patbenatar 1.2.2 patbenatar.advanced-new-file-1.2.2
copilot GitHub 1.100.306 github.copilot-1.100.306
csharp ms-dotnettools 2.0.320 ms-dotnettools.csharp-2.0.320-win32-x64
csharp-utilities irishbruse 0.4.3 irishbruse.csharp-utilities-0.4.3
cursor-align yo1dog 1.1.2 yo1dog.cursor-align-1.1.2
dark-theme IrishBruse 1.5.7 irishbruse.dark-theme-1.5.7
errorlens usernamehw 3.12.0 usernamehw.errorlens-3.12.0
file-nesting antfu 1.1.2 antfu.file-nesting-1.1.2
gitlens eamodio 14.1.1 eamodio.gitlens-14.1.1
hexeditor ms-vscode 1.9.12 ms-vscode.hexeditor-1.9.12
java redhat 1.21.0 redhat.java-1.21.0-win32-x64
markdown-all-in-one yzhang 3.5.1 yzhang.markdown-all-in-one-3.5.1
material-icon-theme PKief 4.29.0 pkief.material-icon-theme-4.29.0
material-product-icons PKief 1.5.0 pkief.material-product-icons-1.5.0
msbuild-project-tools tintoy 0.4.9 tintoy.msbuild-project-tools-0.4.9
prettier-vscode esbenp 10.1.0 esbenp.prettier-vscode-10.1.0
smartersemicolon irishbruse 1.1.2 irishbruse.smartersemicolon-1.1.2
vscode-dotnet-runtime ms-dotnettools 1.6.0 ms-dotnettools.vscode-dotnet-runtime-1.6.0
vscode-eslint dbaeumer 2.4.2 dbaeumer.vscode-eslint-2.4.2
vscode-github-actions github 0.25.8 github.vscode-github-actions-0.25.8
vscode-java-debug vscjava 0.53.0 vscjava.vscode-java-debug-0.53.0
vscode-jest Orta 5.2.3 orta.vscode-jest-5.2.3
vscode-js-profile-flame ms-vscode 1.0.5 ms-vscode.vscode-js-profile-flame-1.0.5
vscode-settings-cycler hoovercj 1.0.1 hoovercj.vscode-settings-cycler-1.0.1
vscode-sort-json richie5um2 1.20.0 richie5um2.vscode-sort-json-1.20.0
vscode-thunder-client rangav 2.10.0 rangav.vscode-thunder-client-2.10.0
vscode-versionlens pflannery 1.5.0 pflannery.vscode-versionlens-1.5.0
vscode-xml redhat 0.26.1 redhat.vscode-xml-0.26.1-win32-x64
vscode-yaml redhat 1.14.0 redhat.vscode-yaml-1.14.0

Extension version: 2.0.320
VS Code version: Code 1.80.2 (2ccd690cbff1569e4a83d7c43d45101f817401dc, 2023-07-27T20:40:28.909Z)
OS version: Windows_NT x64 10.0.19044
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz (4 x 3504)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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) 7.94GB (1.75GB free)
Process Argv --folder-uri file:///a%3A/RaylibSharp --crash-reporter-id d3240052-24f9-4bd8-a1bd-17bb54be6cf9
Screen Reader no
VM 0%

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions