Hi,
Because of reuse, I need to mix C# project and VB.net
project. To illustrate the problem, I have built 3 simple
projects:
1) C# library--projc (has one class "Manager")
2) vb.net library--projb (has one class "Bob")
3) vb.net web form--projweb (has one web form with a
label on it)
Here are the code:
projc:
using System;
using busivb;
namespace clib
{
public class Manager
{
public Manager()
{
}
public static void Add(Bob bob)
{
bob.Name="hello";
}
}
}
projb:
Namespace busivb
Public Class Bob
Dim _name As String
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal Value As String)
_name = Value
End Set
End Property
End Class
End Namespace
projweb
Imports busivb
Imports clib
Namespace testvbweb
Public Class WebForm1
Inherits System.Web.UI.Page
--" Web Form Designer Generated Code "--
Private Sub Page_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Dim abob As New Bob
Manager.Add(abob)
lbName.Text = abob.Name
End Sub
End Class
End Namespace
I got "Reference required to assembly 'busivb' containing
the type 'busivb.Bob'. Add one to your project." error
for the line:
Manager.Add(abob)
in the form.
Can you tell me what is wrong? Thanks.