Missing compiler required member
Ksdmg opened this issue · comments
Ksdmg commented
Actual behavior
When adding the apis QueryDosDevice
and GetVolumePathNamesForVolumeName
to a .NET Standard 2.0 project, a warning is generated and it's not possible to compile the project.
Severity Code Description Project Path File Line Suppression State Details
Error CS0656 Missing compiler required member 'System.Runtime.CompilerServices.RuntimeHelpers.get_OffsetToStringData' Incoe.Common.WinApi ~\Microsoft.Windows.CsWin32\Microsoft.Windows.CsWin32.SourceGenerator ~\Microsoft.Windows.CsWin32\Microsoft.Windows.CsWin32.SourceGenerator\Windows.Win32.PInvoke.KERNEL32.dll.g.cs 203 Active
As soon as I change TargetFramework to at least net6.0
the project compiles without any code changes.
Expected behavior
The project should simply compile.
Repro steps
NativeMethods.txt
content:
QueryDosDevice
GetVolumePathNamesForVolumeName
- Any of your own code that should be shared?
Context
- CsWin32 version:
0.3.49-beta
- Target Framework:
netstandard2.0
LangVersion
9
Andrew Arnott commented
It works for me. Here's my repro project. It contains the same NativeMethods.txt file that yours does. Does it work for you?
Andrew Arnott commented
Closing due to no response.