Closed vitkuz573 closed 9 months ago
This is by design. Per the win32metadata that is the basis for code generation, the ShellExecuteEx
function references the SHELLEXECUTEINFOW
type, which is declared differently for x86 than for x64 and arm64 architectures. This makes it impossible to emit one C# declaration of the struct that will work on any CPU.
So per the error message, if you change your project to target specific platforms, you'll get what you need.
Actual behavior
ShellExecuteEx
is not generated with the message warning PInvoke005: This API is only available when targeting a specific CPU architecture. AnyCPU cannot generate this API. But at the same time ShellExecute is generated correctlyIs this an error?
Expected behavior
Correct generation of
ShellExecuteEx
Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):Any of your own code that should be shared?
Context
0.4.422-beta
] 0.3.51-betanetstandard2.0
] net8.0LangVersion
(if explicitly set by project): [e.g.9
] latest