views:

185

answers:

1

I have a multi-project .NET 3.5 solution.

It's ASP.NET based with c# code-behind in all projects except one.

I'm attempting to access members from a C# project called "Core" from a VB.NET project.

I set a dependency to the Core solution in my solution properties.

However, Core. brings up nothing.

Furthermore, my other C# projects that have Core-Project as a dependency (in the solution settings), are able to declare Core objects. Example: Private Core.ObjectName InstanceName; Also, Intellisense brings up plenty of info in the C# projects.

Any idea on how I can hook into these members from my VB project?

Thanks!

+5  A: 

Add the C# project as a reference, not a dependency. This is done through the solution explorer by right-clicking on References underneath the VB project. You'll see a window pop up; select the Projects tab and find your C# project there.

Dependencies, by contrast, only influence the build order. You can set a project to depend on another (i.e. ensuring the other is built first), but that doesn't allow the first project to use the other project's code.

Finally, setting a reference also automatically sets a dependency, so you don't need to do both.

Ben M
As a tip to anybody else that stumbles across this. Be very careful about copy/pasting c-sharp code into your vb files in visual web developer 2008. I copied a bunch over and attempted to convert it to VB.Net. Somehow, this really, really goofed things up and undoing all of my changes resulted in a vb.net project that wouldn't run. After reverting to a previous revision with subversion, I started by adding the reference, then adding in code bit by bit. The IDE agreed with this and everything is working like a charm. Thanks Ben
hamlin11