Problem building with InternalsVisibleTo with projects having workflows with default value set to ar

To reproduce :

– Create a C# Class library project with this class :  

namespace ClassLibrary1

{

 internalclass Class1 {}

}

– Create a new C# Test Project and create this unit test class :

using ClassLibrary1;

using Microsoft.VisualStudio.TestTools.UnitTesting;



namespace TestProject1

{

 [TestClass]

 publicclass UnitTest1

 {

  [TestMethod]

  publicvoid TestMethod1 ()

  {

   // this is ok : 

   Class1 class1 = new Class1 ();

  }



  // Compile time problem :// Error 1 'ClassLibrary1.Class1' est inaccessible en raison de son niveau de protection// Error 4 Accessibilité incohérente : le type de paramètre 'ClassLibrary1.Class1' est moins accessible que la méthode 'TestProject1.UnitTest1.TestA(ClassLibrary1.Class1)'privatestaticvoid TestA (ClassLibrary1.Class1 a)

  {

  }



  // Compile time problem :// Error 1 'ClassLibrary1.Class1' est inaccessible en raison de son niveau de protection// Error 2 Accessibilité incohérente : la classe de base 'ClassLibrary1.Class1' est moins accessible que la classe 'TestProject1.UnitTest1.Derived'internalclass Derived : Class1

  {

  }

 }

}



– Add a InternalsVisibleTo atribute into the class library project :

[assembly:InternalsVisibleTo ("TestProject1")]

– Add a new “WorkflowActivity” item into the test project.

– Add an Int32 In Argument into the created activity.

– Set the Default value to 5

– Try building

– Result : I get 4 errors at build time (see the comments into the unit test class).

Is there any way to get around the problem?

Also, I have a second way to reproduce  it, and this one is more problematic :- Do the same solution as the first exemple.- Remove the default  value of the inargument (so we can build again)- create  a new Code Activity in the unit test  project- Build so we can see the new Code Activity in the toolbox of the activity designer.- In the Activity1.xaml, add the new created code activity.- Result : the same thing as the previous post./

Someone has the same problem?

I do.As soon as I add a CodeActivity to a workflow in an assembly, this assembly stops seeing the internals of the assemblies declaring the InternalsVisibleTo attribute. Using the WF standard activities don’t have this problem. gabriel