473,406 Members | 2,549 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,406 software developers and data experts.

.NET is riddled with bugs when mixing C# and VB

For all Microsoft's blah about C# and VB being completely mixable and
interchangeable, I recommend for anyone who can still take this
advice:

DO NOT MIX VB AND C# PROJECTS IN THE SAME SOLUTION!

The compiler simply goes to pieces when it is confronted with the
combination of a VB project (A) referencing a C# project (B) that
references another VB project (C)

If you have a class (D) in project B that inherits/implements a
class/interface (E) from C, then any attempt to reference class D from
project A will cause the compiler to fail: "Reference required to
assembly 'C' containing the implemented interface 'E'. Add one to your
project.

If you have an interface (F) in project B that inherits an interface
(G) from project C, then any attempt to implement that interface in a
class in project A is also doomed to failure. Even using that
oh-so-clever interface stub generator that VB provides, the very stub
it generates will cause a compiler error.

I've seen a lot of other threads about this. Yes, project A *does*
reference BOTH project B AND project C. Been there, done that. This
is simply a BUG in the .NET compiler, and you can test it for yourself
pretty easily if you don't believe me... ;)

Regards,
Saul
Jul 21 '05 #1
2 1580
You can get around this by compiling the dependent pieces first, but I agree
with you about mixed solutions. It gets better in .NET 2.0, especially on
ASP .NET projects.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Saul Behr" <go***************@sabreton.com> wrote in message
news:e7**************************@posting.google.c om...
For all Microsoft's blah about C# and VB being completely mixable and
interchangeable, I recommend for anyone who can still take this
advice:

DO NOT MIX VB AND C# PROJECTS IN THE SAME SOLUTION!

The compiler simply goes to pieces when it is confronted with the
combination of a VB project (A) referencing a C# project (B) that
references another VB project (C)

If you have a class (D) in project B that inherits/implements a
class/interface (E) from C, then any attempt to reference class D from
project A will cause the compiler to fail: "Reference required to
assembly 'C' containing the implemented interface 'E'. Add one to your
project.

If you have an interface (F) in project B that inherits an interface
(G) from project C, then any attempt to implement that interface in a
class in project A is also doomed to failure. Even using that
oh-so-clever interface stub generator that VB provides, the very stub
it generates will cause a compiler error.

I've seen a lot of other threads about this. Yes, project A *does*
reference BOTH project B AND project C. Been there, done that. This
is simply a BUG in the .NET compiler, and you can test it for yourself
pretty easily if you don't believe me... ;)

Regards,
Saul

Jul 21 '05 #2
I have seen the same thing when using just a single language and the reference
heirachy is complicated. I have also mixed C# and VB quite successfully. The
keys I have found are both in what Cowboy and David point out. It is an IDE
issue, and compiling the dependant projects first, and in the proper order is
the ticket. This can be done in the IDE or via the command line. So it appears
to be an IDE quirk that is being addressed.

Gerald

"Saul Behr" <go***************@sabreton.com> wrote in message
news:e7**************************@posting.google.c om...
For all Microsoft's blah about C# and VB being completely mixable and
interchangeable, I recommend for anyone who can still take this
advice:

DO NOT MIX VB AND C# PROJECTS IN THE SAME SOLUTION!

The compiler simply goes to pieces when it is confronted with the
combination of a VB project (A) referencing a C# project (B) that
references another VB project (C)

If you have a class (D) in project B that inherits/implements a
class/interface (E) from C, then any attempt to reference class D from
project A will cause the compiler to fail: "Reference required to
assembly 'C' containing the implemented interface 'E'. Add one to your
project.

If you have an interface (F) in project B that inherits an interface
(G) from project C, then any attempt to implement that interface in a
class in project A is also doomed to failure. Even using that
oh-so-clever interface stub generator that VB provides, the very stub
it generates will cause a compiler error.

I've seen a lot of other threads about this. Yes, project A *does*
reference BOTH project B AND project C. Been there, done that. This
is simply a BUG in the .NET compiler, and you can test it for yourself
pretty easily if you don't believe me... ;)

Regards,
Saul

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: bergel | last post by:
Hello, Does anyone already have some experience in mixing AWT and Swing? Is it conceptually doable? Does the design of Swing prevent interaction between an AWT and a Swing widget? Regards,...
83
by: kartik | last post by:
there seems to be a serious problem with allowing numbers to grow in a nearly unbounded manner, as int/long unification does: it hides bugs. most of the time, i expect my numbers to be small. 2**31...
2
by: Saul Behr | last post by:
For all Microsoft's blah about C# and VB being completely mixable and interchangeable, I recommend for anyone who can still take this advice: DO NOT MIX VB AND C# PROJECTS IN THE SAME SOLUTION!...
2
by: TheSteph | last post by:
Using : Windows 2000 Pro SP4 / VS.NET 2005 / .NET 2.0 / C# - All updates done. I have several bugs when I use the DataGridView : When scrolling (or after scrolling) the grid have these...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
28
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later...
10
by: Ivan Vecerina | last post by:
Here's a relatively simple code snippet: #include <memory> class Base { public: Base(); virtual ~Base(); virtual void f(int a, char const* name);
26
by: ak | last post by:
Recently at an interview i was asked the following question : Assuming the function lookupName is defined, what's wrong with this code (hint: 2 bugs)? const char *getName(const char *c) {...
2
by: Dave Johansen | last post by:
I just converted a solution from Visual Studio 2003 to Visual Studio 2005 and the Debug mode seems to be running just fine, but the Release mode crashes on the following code: std::ifstream...
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...
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
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,...
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
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...
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...

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.