473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 1548
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
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
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
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
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
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
6
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.