Originally posted by **thxkiwi** May 31, 2024
I have a project that I wrote using targeting framework net80 and trying to get it working with net481/LangVersion 10.
CsWin32: 0.3.106
Using Visual Studio 17.10.0.
I've modified the SDK project files to be
```
net481enableenablex6410true
```
CsWin32 is generating Windows.Win32.char.InlineArrays.g.cs:84 - `Unsafe.SkipInit(out __char_260 result);`
```
public static unsafe implicit operator __char_260(ReadOnlySpan value)
{
Unsafe.SkipInit(out __char_260 result);
Span target = new Span(result.Value, SpanLength);
value.CopyTo(target);
int initLength = value.Length;
target.Slice(initLength, SpanLength - initLength).Clear();
return result;
}
```
That seems to be .NET 8 only still.
Am I missing something (including "the point") here? It seemed possible and reasonable to target net481 and LangVersion 10.
Help and guidance greatly appreciated.
Per the discussion this came from, the issue seems to be that Unsafe.SkipInit comes from a package that wasn't referenced in the compilation. CsWin32 should be more cautious about this.
Discussed in https://github.com/microsoft/CsWin32/discussions/1191