This topic has not yet been rated - Rate this topic

Linker Tools Warning LNK4251

Error Message

AllowPartiallyTrustedCallersAttribute assembly attribute used without specifying /CLRUNMANAGEDCODECHECK

If you use AllowPartiallyTrustedCallersAttribute in your code, you should explicitly set /CLRUNMANAGEDCODECHECK. It is a potential security vulnerability if an image contains both the SuppressUnmanagedCodeSecurity and AllowPartiallyTrustedCallers attributes.

For more information, see /CLRUNMANAGEDCODECHECK (Add SupressUnmanagedCodeSecurityAttribute).

Example

The following sample generates LNK4251.

// LNK4251.cpp
// compile with: /clr /LD /W1
// LNK4251 expected
[assembly:System::Security::AllowPartiallyTrustedCallersAttribute];
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ