Closed dilaratank closed 2 years ago
I've never seen an error like this before. I agree this field name looks like it's backing an auto-property. We probably shouldn't be using auto-properties in structs for interop purposes, although in this case it's the only field so it shouldn't cause any functionally incorrect interop. We can fix this by defining the field ourselves. I'm surprised that the MCG tool (whatever that is) has a problem with it.
Thanks so much for the quick reply and fix. Do you have any information on when a new version will be released on NuGet? :)
We just released one a week ago, and we have some active PRs, so probably not in the next several days. But you can read the paragraph in our readme just above the contribution section for a tip on how to consume the packages from our CI if you can't wait for the next release.
I have updated PInvoke.BCrypt, PInvoke.Windows.Core, and PInvoke.Kernel32 using the NuGet packages to version 0.7.124 because of a warning I got about deprecated debug information levels.
Debug builds are all successful and I can deploy my app. However, release builds result in the following error:
MCG0037: MCG0037:InvalidCSharpIdentifierName Struct 'PInvoke.Kernel32+ACCESS_MASK' in assembly 'Assembly(Name=PInvoke.Kernel32, Version=0.7.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a)' has a field with name '
<Value>k__BackingField
' that is invalid. This could be because the name is obfuscated or the field is auto-implemented by the compiler. Please make sure the field name follows C# identifier conventions. ChipSoft.Mobile.Apps.HiX.XF.UWPHow can this be fixed?