473,498 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I access a C# assembly from VB?

I know this sounds really basic, but I'm having trouble with this within the
VS.Net 2003 Pro IDE.

I'm working with a VB.Net class library, and I'm having it reference a
compiled assembly (a .dll) in a folder, which was written in C#. Both my
VB.Net class library and the C# assembly contain the same namespace.

After I "Add Reference" the C# assembly to the VB.Net project, the C#
assembly shows up in the list of referenced assemblies in the Solution
Explorer. So far so good.

Within the VB.Net class library I'm attempting to use a couple of classes
implemented in the C# assembly, but neither the IDE nor the VB compiler seem
to see them. I know that both classes are defined within the same namespace
(the same one used in my VB class library), and they are both declared
public. Yet, when I try to access these classes, the compiler acts like it
can't see them. It says they aren't declared.

I also know that these classes are normally accessible, because I use the
same assembly from within my ASP.Net application code (also written in C#),
and it sees these classes just fine.

When I type the namespace into the IDE editor, as in "<namespace>.",
Intellisense just shows me the one class defined within that namespace in my
VB class library. It doesn't see the classes defined in that namespace in
the referenced assembly.

Any ideas? Am I missing something? Is this a bug in VB?

Thanks,

---Mark

Nov 22 '05 #1
1 1549
Okay. Figured it out. It turned out the "Root namespace" setting in the VB
project properties was set to the VB Project's name, rather than the global
namespace I had set up in my VB and C# code. Once I fixed that, then
everything started working.

---Mark

"Mark Miller" wrote:
I know this sounds really basic, but I'm having trouble with this within the
VS.Net 2003 Pro IDE.

I'm working with a VB.Net class library, and I'm having it reference a
compiled assembly (a .dll) in a folder, which was written in C#. Both my
VB.Net class library and the C# assembly contain the same namespace.

After I "Add Reference" the C# assembly to the VB.Net project, the C#
assembly shows up in the list of referenced assemblies in the Solution
Explorer. So far so good.

Within the VB.Net class library I'm attempting to use a couple of classes
implemented in the C# assembly, but neither the IDE nor the VB compiler seem
to see them. I know that both classes are defined within the same namespace
(the same one used in my VB class library), and they are both declared
public. Yet, when I try to access these classes, the compiler acts like it
can't see them. It says they aren't declared.

I also know that these classes are normally accessible, because I use the
same assembly from within my ASP.Net application code (also written in C#),
and it sees these classes just fine.

When I type the namespace into the IDE editor, as in "<namespace>.",
Intellisense just shows me the one class defined within that namespace in my
VB class library. It doesn't see the classes defined in that namespace in
the referenced assembly.

Any ideas? Am I missing something? Is this a bug in VB?

Thanks,

---Mark

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2075
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
5
2930
by: Raterus | last post by:
I'm just throwing this error out for my sanity, I've seen posts about this, but never solutions. I'm using VS.NET 2003, Framework 1.1, and I'm getting a random error about every 1 out of 10 times...
16
7356
by: Brad | last post by:
After compiling my asp.net project I'm receiving a "BC31011 - Access is denied" error when attempting to run or debug. The only thing that seems to resolve problem is IISReset. After a reset my...
3
7969
by: Shailesh Humbad | last post by:
I figured out what was causing the "Access is Denied" error when calling functions from referenced DLLs in my service. I've tried to be very detailed, so bear with me. It turns out that...
4
12258
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
6
2551
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes but a new install on a new machine retruns...
5
2660
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all...
9
2144
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service)...
8
6031
by: Jeremy Ames | last post by:
I am trying to move an application from my system to a new test system. I really should have tried an easier program first, but I didn't really have a chance. My application was originally written in...
0
3926
by: Andy | last post by:
Thanks Peter, I thought I'd give an update on this problem. My application had 2 assemblies that contained classed for the Data access and business logic layer. It was on one of them that I was...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.