473,508 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ANS: Erroneous Compiler Errors When Building

I thought I would pass this on, as I have oft' seen this problem reported,
with no solution.

The problem is that in a solution containing several projects, the compiler
will sometimes report a selection of errors that are quite false. For
example, on one build the error "... cannot handle event because they do not
have the same signature" might be reported. Build again and the problem goes
away. Change something unrelated and the problem reappears. Restarting the
IDE can sometimes cause the problem to vanish temporarily, but on a
subsequent rebuild it comes back.

Another error that can be reported incorrectly is that an assembly requires
a reference to another assembly when it already has a reference.

The problem can also be characterised by errors being reported when you try
to debug (F5). The "Errors were reported. Do you wish to continue?" dialog
is displayed and in the task list you can see a list of unexpected errors.
Click No, and the dialog closes, and the errors vanish.

It turns out that the fault lies with the compiler. It sometimes gets
confused when a project in a solution references the assembly created by
another project in the same solution. It doesn't recognise that the
reference to the assembly is the same as the project (I hope that makes
sense).

The good news is that there is a workaround.

If you need to reference an assembly created by another project in your
solution, add it as a 'Project Reference'. You will see the difference if
you go to the Project menu, and open the Add Reference dialog.

The third tab is Projects. Click on it and you will see a list of all the
projects in your solution.

If you add your reference from this dialog, rather than browsing to a
directory for it, you will no longer get the problem. Make sure you don't
mix file references and project references in the same solution, though, as
this will likely make the problem worse.

There a couple of beneficial side-effects too. Your solution will build
quicker, as the compiler will not build assemblies that haven't changed (I
know it should do this anyway, but it doesn't).

The other advantage is that if you try to navigate to a definition
(Shift+F2) that is in another project within your solution, the IDE will
take you there instead of opening up the object browser window.

Anyway, I hope this helps someone.

Charles
[The reason for the error, and workaround are courtesy of Microsoft, who
were extremely helpful - as always - in diagnosing the problem with me over
the last few weeks]
Nov 20 '05 #1
0 1084

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

Similar topics

8
1865
by: jon morgan | last post by:
OK, I'm going to be brave. There is a bug in VS.Net 1.1 that causes random compiler errors. I have raised this issue in posts at least three time in the past couple of months without attracting...
4
1534
by: jhonyxxx | last post by:
I have the next programa in C++: #include <iostream.h> // C++ I/O routines #include <list.h> // The STL list class #include<stdio.h> #include <string.h> typedef struct { char nombre; int...
10
2535
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
3
5241
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
1
2446
by: Skip | last post by:
Hi, I created a COM object in C# and everything works fine on my machine. Now, the compiler gives me the following messages when compiling my code: ------ Rebuild All started: Project: SI,...
1
1903
by: Claire | last post by:
I have a project that uses TChart assembly. I don't think that the assembly's the problem though. If I compile in debug mode with CopyLocal set to true, the solution builds perfectly. In Release...
1
3743
by: kvarada | last post by:
Hello Experts, I am building my application on WinNT.4.0_i386_MSVC.7.1 platform. When I build the application on a stand alone machine, it builds fine. But when I build the same application from a...
1
2255
by: dileepd | last post by:
Hi Every one, Could you please let me know if you have any clue about following things. 1. Whether type bool acts like a kind of signed int type in g++ on solaris 9(a/c to my invetsigation it...
0
1476
by: Grant Edwards | last post by:
I've got a system where I try to install extensions using /usr/local/bin/python setup.py install But, it fails when it tries to use a non-existant compiler path and specs file. I suspect it's...
0
7228
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
7128
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
7393
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
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
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 ...
0
426
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...

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.