This documentation is archived and is not being maintained.

Compiler Error CS1725

Visual Studio 2008

Friend assembly reference 'reference' is invalid. InternalsVisibleTo declarations cannot have a version, culture, public key token, or processor architecture specified.

You cannot add a version culture in a friend assembly reference. Partial classes should be visible to friend assemblies.

The following sample generates CS1725.

// CS1725.cs
// compile with: /target:library
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleTo("partial01,version=")]   // CS1725
// try the following line instead
// [assembly:InternalsVisibleTo("partial01")]

partial class TestClass 
   public static string strBar = "my string";