Cannot set assembly global attributes when not generating an assembly
A source code file cannot contain assembly global attributes if it will be compiled with /target:module.
The following sample generates CS0640:
using System; using System.Interop; [assembly : AttrClass()] // CS0640 class AttrClass : Attribute { } class MyClass { public static void Main() { } }