1

I have 2 projects in a solution, one a vb.net class library project, another a C# class library project.

As far as I was aware I was able to compile both and reference each from the other project, (one way at a time).

I can reference namespaces / classes found in the VB.NET project within the C# project. However I don't seem to be able to do the same in the opposite direction. I can't seem to use any namespaces / classes exposed in the C# library from within the VB.NET project, even though the library appears to be referenced correctly.

Am I missing something here?

EDIT: I am aware that cyclic references are not permitted and no I am not referencing each library from the other at the same time. I don't have any compilation errors relating to cyclic referencing.

5
  • 3
    Are you trying to reference project B in project A, while project A is referenced in project B? Commented Jun 21, 2013 at 10:50
  • 3
    What do you mean exactly by "can't"? What happens when you try? Have you managed to add the reference? (You can't have cyclic references.) Commented Jun 21, 2013 at 10:50
  • Sorry no I'm aware cyclic references are not permitted (see edit) @Jon, when I say I "can't", I mean I can't see anything in intellisense within my vb project for namesspaces / classes in my c# project. I can however see intellisense for vb namesspaces / classes in my c# project when I reference in the same way. I don't have any compilation errors that relate to cyclic referencing. Commented Jun 21, 2013 at 11:03
  • 1
    So when you said: "As far as I was aware I was able to compile both and reference each from the other project" you didn't actually mean it? Or you meant it only one way at a time? I hope you can see how your question is confusing. Are your C# types public? Can you reproduce this with a small solution with just a single type in each project? Commented Jun 21, 2013 at 11:08
  • Sorry, I see what you mean, it does come across slightly confusing. Yes I meant one way at a time, my apologies. Yes the types are public, but namespaces aren't visible either. Commented Jun 21, 2013 at 11:13

3 Answers 3

2

This is because you cannot create circular references.

If the ddl of your first project is referenced in the second one there is no way you can add the other project as a reference also.

When building the solution both projects would depend on each other and this will fail.

Sign up to request clarification or add additional context in comments.

Comments

1

This was an error on my part.

The problematic C# types in question that I could not see within my vb project had been set to content rather than compile within Visual Studio. This possibly occurred due to some file movement between the projects.

Comments

0

For me the reference error was due to difference in framework version. After I changed the version from project properties, the reference error got resolved.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.