Compiler Error C2262

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2262.

attribute_specifiers' : InternalsVisibleTo declarations cannot have a version, culture, or processor architecture specified

The InternalsVisibleToAttribute attribute was not specified correctly.

The following sample generates C2262.

// C2262.cpp  
// compile with: /clr /c  
using namespace System::Runtime::CompilerServices;  
[assembly: InternalsVisibleTo("assembly_name, version=1.2.3.7")];   // C2262  
[assembly: InternalsVisibleTo("assembly_name ")];   // OK  

Show: