You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to use the Embedding option in my C# application.
This app uses <Nullable>enable</Nullable> and <WarningsAsErrors>Nullable</WarningsAsErrors>.
I am getting a lot of errors/warnings, like these: error CS8625: Cannot convert null literal to non-nullable reference type. error CS8769: Nullability of reference types in type of parameter 'value' doesn't match implemented member
I understand that CsWinRT and WinRT do not support Nullable.
You could help mitigate this problem if the generated files were explicitly marked as generated files. This would automatically suppress some warnings as appropriate.
This can be done in a multitude of ways.
One way is to use the file extension ".g.cs" or to use a <auto-generated> header.
To Reproduce
I think this is a general and understood issue, I can provide a repro project if needed.
Expected behavior
CsWin32 uses this header:
// ------------------------------------------------------------------------------// <auto-generated>// This code was generated by a tool.//// Changes to this file may cause incorrect behavior and will be lost if// the code is regenerated.// </auto-generated>// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
Describe the bug
I am trying to use the Embedding option in my C# application.
This app uses
<Nullable>enable</Nullable>
and<WarningsAsErrors>Nullable</WarningsAsErrors>
.I am getting a lot of errors/warnings, like these:
error CS8625: Cannot convert null literal to non-nullable reference type.
error CS8769: Nullability of reference types in type of parameter 'value' doesn't match implemented member
I understand that CsWinRT and WinRT do not support Nullable.
You could help mitigate this problem if the generated files were explicitly marked as generated files. This would automatically suppress some warnings as appropriate.
This can be done in a multitude of ways.
One way is to use the file extension ".g.cs" or to use a
<auto-generated>
header.To Reproduce
I think this is a general and understood issue, I can provide a repro project if needed.
Expected behavior
CsWin32 uses this header:
That seems like a good idea.
Version Info
Additional context
None
The text was updated successfully, but these errors were encountered: