Assembly Reference Problems

  • Thread starter Thread starter Ryan Gregg
  • Start date Start date
R

Ryan Gregg

I'm having a major problem with assembly references that I keep running
into, and I'm really hoping that someone can help me out. The problem
occurs when I have three projects in my solution, two of which I have
developed in VB.NET and one in C#. When I use Project A (VB) inside Project
B (C#), and then from Project C (VB) reference methods of Project B that
uses classes from Project A, I get an error that indicates I need to include
a reference to the original project. However, I've already included a
reference, and in fact can use the same exact type that I'm trying to use
that's generating an error on the function call anywhere else in the
function.

I have a more detailed write up of the problem, with some example code that
reproduces the problem in very few lines on my website at
http://ryangregg.com/archive/2004/01/21/188.aspx. If someone out there
could take the time to look at this and see if they can give me a solution,
I would very much appreciate it.

Thanks in advance.

Ryan Gregg
 
Ryan,
I posted the following on your web site at
http://ryangregg.com/archive/2004/01/21/188.aspx
-------------------------------------------------
This seems to be a known bug in VS.NET with cross-referencing VB and C#
assemblies, please refer to the following google links for symilar posts.
(the URLs are quite long and may wrap around)

[URL #1]
http://groups.google.com/groups?hl=...UTF-8&q=project-to-project+assembly+reference>&lr=&ie=UTF-8&oe=UTF-8&threadm=QZdkywmJDHA.2284%40cpmsftngxa06.phx.gbl&rnum=10&prev=/groups%3Fsourceid%3Dnavclient%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dproject-to-project%2Bassembly%2Breference

[End of URL #1]

[URL #2]
http://groups.google.com/groups?hl=...UTF-8&q=project-to-project+assembly+reference>&lr=&ie=UTF-8&oe=UTF-8&threadm=eWmg4OEkCHA.2736%40tkmsftngp10&rnum=7&prev=/groups%3Fsourceid%3Dnavclient%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dproject-to-project%2Bassembly%2Breference

[End of URL #2]

Looks like the only way out of this is either to rewrite the code using the
same language, or to reference the binary assemblies instead of projects.

My company is the author of a build automation and management tool called
VisualMake (http://www.visualmake.com), which, among other things, will
resolve the project references to their respective binaries during build
time. I just built your sample solution using VisualMake - no problem at
all. If you want to try it, a fully functional trial is available from the
web site.

Regards
 
I have the same error "Reference required to assembly" with
cross-referencing VB and C# assemblies.
I tried to follow the suggestions in provided by Gagik Google links to
replace project-to-project references to file references.
Now I have errors like
Value of type 'Namespace.ClassName' cannot be converted to
'Namespace.ClassName'.(Note that both 'Namespace.ClassName' are the
same).
It seems that compiler tries to match different versions of the same
DLL. I've tried to change "Local Copy" to false and back but still have
errors.
Does anyone can suggest other workarounds within Visual Studio.Net
without rewriting all projects to one language?

Michael Freidgeim
Add ".com.au" to my e-mail address to reach me by e-mail
 
Back
Top