Navigation: X# Documentation > X# Compiler Errors and Warnings
Error XS7042
The DllImport attribute cannot be applied to a method that is generic or contained in a generic type.