Closed 0x5bfa closed 7 months ago
CONNECT_UPDATE_PROFILE
is a value on an enum in the metadata. When you compile your project, a warning should have been produced telling you to switch asking for CONNECT_UPDATE_PROFILE
out for asking for the enum type name itself. Do you see that when you build?
I could not find the enum name. Looking at the docs about WNetCancelConnection2A, I have thought this is defined by #define directive.
When I put CONNECT_UPDATE_PROFILE
into my NativeMethods.txt file, I see this warning when building, which tells you the name of the enum to use:
CsWin32Sandbox\NativeMethods.txt(1,1,1,23): warning PInvoke004: Use the name of the enum that declares this constant: NET_USE_CONNECT_FLAGS
How do I know that enum class before building?
You might not know before building, but since building emits a warning that tells you the enum type name, you can then fix it.
Actual behavior
CONNECT_UPDATE_PROFILE cannt be found though I added this const to the NativeMethods.txt file.
Expected behavior
It must be found.
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Any of your own code that should be shared?
Context
LangVersion
: 9