An object of this class will be passed to an API call. I implemented the first suggestion from the warning below:
To reduce security risk, marshal field 'Resource.k__BackingField' as Unicode, by setting StructLayout.CharSet on 'Resource' to CharSet.Unicode, or by explicitly marshaling the field as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, use the BestFitMapping attribute to turn best-fit mapping off, and for added security, to turn ThrowOnUnmappableChar on.
Now my class looks similar to this:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public class Resource
{
public string Provider;
}
But FxCop is still throwing the same warning. What does it want?