System.Design cannot be referenced in Class Library?

Posted by Alex Yeung on Stack Overflow See other posts from Stack Overflow or by Alex Yeung
Published on 2010-11-18T01:46:03Z Indexed on 2010/12/28 23:53 UTC
Read the original article Hit count: 356

Filed under:
|
|

Hi all,

I have a very strange problem that I cannot fix and don't know what's going on... I am using VS 2010 Premium and .NET 4.0.

Here are my steps to simulate the problem.


Step 1. Create a new VB class library project named "MyClassLib"

Step 2. Create a new class named "MyTestingClass".

Public Class MyTestingClass
    Inherits System.ComponentModel.Design.CollectionEditor

    Public Sub New()
        MyBase.New(GetType(List(Of String)))
    End Sub

End Class

Step 3. Add two .net reference. "System.Design" and "System.Drawing".

Step 4. Create a new VB console application named "MyClassExe"

Step 5. Add "MyClassLib" reference to "MyClassExe".

Step 6. Open Module1.vb in "MyClassExe" project

Step 7. In the Main method, type

Dim a = New MyClassLib.MyTestingClass()

Step 8. Try to compile "MyClassLib". It doesn't have problem.

Step 9. Try to compile "MyClassExe". It cannot compile because the WHOLE MyClassLib cannot be found!!!


I have no idea what's going on?

Moreover, the same case happens in C#.

Does anyone know what's the problem with "System.Design"?

Thank!!!

© Stack Overflow or respective owner

Related posts about .NET

Related posts about references