473,614 Members | 2,089 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 1559
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
2083
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 allow it ro run then it will execute, the code execution depends on the permission provided to the assembly. If the code is not trusted wnough to run or it attempts to perform an action which doe not have the required permissions then its execution...
5
2940
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 I try to start to run/debug a project (through Visual Studio) Server Error in '/Intranet' Application. -------------------------------------------------------------------------------- Compilation Error Description: An error occurred during...
16
7374
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 project runs fine for several compiles then the error starts up again...and another iisreset. I seem to recall a similar issue a long time back which required turning off indexing, which I have had off since (I just re-checked to confirm it is...
3
7990
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 libraries I made myself were not having this problem, but it only happened with a zip library I downloaded and copied into my program's directory. When using classes from this library, my service threw an "Access Is Denied" FileLoadException, which...
4
12268
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
6
2560
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 errors. The machine is a new laptop Windows XP Pro SP2 The machine is up to date with respect to the dot net framework. Details: Dot Net Framework ver. 1.0.3705 is installed Dot Net Framework ver. 1.1.4322 is installed
5
2681
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 that's come before. To take an extreme example, suppose you have been writing Visual Basic applications for years now. If you're like many developers, you will have built up a substantial inventory of code in that time. And if you've been following...
9
2155
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) Hide.dll methods and data I want to remain hidden I have a DLL, Hide.dll, that contains methods that I want to handle for
8
6040
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 ASP.NET 1.1, but was migrated to 2.0 during development. The reason this is an issue is because the application is using the Microsoft.Web.UI.WebControls.dll for the tree view and tab strip controls that didn't exist prior to 2.0. Well, that is...
0
3942
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 getting the Access denied error. After checking different settings and googling I wasnt able to pinpoint the problem and as a temporary fix I decided to merge the two assemblies into one, my logic being no offending assembly no access denied...
0
8182
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8130
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8433
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
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 we have to send another system
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1425
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.