473,416 Members | 1,738 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,416 software developers and data experts.

warning C4945 considerably slowing down build

I'm trying to migrate a solution from .NET 1.1 to 2.0 (Visual Studio 2003 to
VS 2005), and I'm getting a ton of "warning C4945" messages. I am not using
MSBuild, I'm just doing a build from within VS 2005. Based on suggestions
from other forums, I tried setting "Copy Local" to false for all references
in all projects, but that didn't help. Any idea what's causing these
warnings? They did not occur in VS 2003.
Oct 22 '07 #1
4 5555
KevinMurphyRJLG <Ke*************@discussions.microsoft.comwrote:
I'm trying to migrate a solution from .NET 1.1 to 2.0 (Visual Studio 2003 to
VS 2005), and I'm getting a ton of "warning C4945" messages. I am not using
MSBuild, I'm just doing a build from within VS 2005. Based on suggestions
from other forums, I tried setting "Copy Local" to false for all references
in all projects, but that didn't help. Any idea what's causing these
warnings? They did not occur in VS 2003.
Have you seen
http://blogs.msdn.com/msbuild/archiv...10/661747.aspx
and phoned support for the Hotfix?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 22 '07 #2
Thanks, Jon. I applied the hotfix and my build goes much faster now. I was
under the impression that the hotfix would get rid of the warnings, but I'll
take the speed up. Build time went from about an hour to a few minutes.

"Jon Skeet [C# MVP]" wrote:
KevinMurphyRJLG <Ke*************@discussions.microsoft.comwrote:
I'm trying to migrate a solution from .NET 1.1 to 2.0 (Visual Studio 2003 to
VS 2005), and I'm getting a ton of "warning C4945" messages. I am not using
MSBuild, I'm just doing a build from within VS 2005. Based on suggestions
from other forums, I tried setting "Copy Local" to false for all references
in all projects, but that didn't help. Any idea what's causing these
warnings? They did not occur in VS 2003.

Have you seen
http://blogs.msdn.com/msbuild/archiv...10/661747.aspx
and phoned support for the Hotfix?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 23 '07 #3
I recently had a C++/CLI project start throwing 351 instances of the C4945 warning on me. The project references 3 C# assemblies, "A", "B", and "C". I suspect the problem comes in because both assembly "C" and the main app reference assembly "A". So when symbols from assembly "A" are imported into the main project at compile time, those warning get thrown because those symbols already exist via assembly "C"'s reference to assembly "A". Hence the message text: "Cannot import symbol ... from assembly ... because the symbol was already defined in assembly ..."

Microsoft's KB922271 article suggests setting "Copy Local" and "Copy Local Dependencies" to false, which accomplishes nothing in this case -- nor does installing the related hotfix.

What I stumbled upon was that setting the "Copy Local..." options back to "true" and setting the "Use Dependencies in Build" and "Use In Build" options to "false" solves the problem. From there, I would guess that taking the reference to assembly "A" out of the main project would also solve the problem, though I haven't tried it yet.

The weird thing is that I have two machines on which I develop this project. Only one of them ever generated this warning message. So I'm not sure what the internals are that cause this message to/not to show up.

But the bottom line is that I would check your references, and see if you have two projects in your solution both referencing a third assembly. That seems to be the root cause.

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Dec 14 '07 #4
Changing "Use In Build" to false caused some compile errors, but changing
only "Use Dependencies In Build" to false got rid of all the C4945 warnings.
Thanks a lot!

"Graeme Swallow" wrote:
I recently had a C++/CLI project start throwing 351 instances of the C4945 warning on me. The project references 3 C# assemblies, "A", "B", and "C". I suspect the problem comes in because both assembly "C" and the main app reference assembly "A". So when symbols from assembly "A" are imported into the main project at compile time, those warning get thrown because those symbols already exist via assembly "C"'s reference to assembly "A". Hence the message text: "Cannot import symbol ... from assembly ... because the symbol was already defined in assembly ..."

Microsoft's KB922271 article suggests setting "Copy Local" and "Copy Local Dependencies" to false, which accomplishes nothing in this case -- nor does installing the related hotfix.

What I stumbled upon was that setting the "Copy Local..." options back to "true" and setting the "Use Dependencies in Build" and "Use In Build" options to "false" solves the problem. From there, I would guess that taking the reference to assembly "A" out of the main project would also solve the problem, though I haven't tried it yet.

The weird thing is that I have two machines on which I develop this project. Only one of them ever generated this warning message. So I'm not sure what the internals are that cause this message to/not to show up.

But the bottom line is that I would check your references, and see if you have two projects in your solution both referencing a third assembly. That seems to be the root cause.

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Dec 17 '07 #5

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

Similar topics

16
by: TheKeith | last post by:
I'm writing a script with a while loop in it. How can I get it to go slower so that it doesn't appear to happen all at once--so that it looks animated--basically. I tried the setTimeout(500) in the...
3
by: Bill Burris | last post by:
How do I find what is causing this warning from the Linker? If I use /NODEFAULTLIB I get hundreds of undefined symbols. LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other...
3
by: Dan Stromberg | last post by:
I have two different python programs that are slowing down quite a bit as their memory use goes up. I'm not really sure if this is some sort of CPU cache effect, or if it's something about...
7
by: Chris Thompson | last post by:
Hi All, I have a private website created using HTML/PHP. Within this site, there is a page that has a form (question.php), which is populated depending on the question number that has been...
7
by: davidst95 | last post by:
Hello, I have a program that runs a long process. I tried to add a thread to check if the use hit a cancel button to abort the process. Dim t As Threading.Thread t = New...
6
by: lawpoop | last post by:
Hello all - I have a problem with a php page. I have a setup with Apache 2.0, PHP 5 and Postgres 8.1 on Debian 4.0. My script uses simplexml to parse large xml files ( 8 files at 2-15 MB ea. )...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
0
by: xpnctoc | last post by:
There is a newsgroup thread posted http://www.thescripts.com/forum/thread726628.html. This site would not let me respond directly to it, which is a shame because I've found an answer that I think...
1
by: =?Utf-8?B?QWRwcm9m?= | last post by:
Since I installed OneCare I have noticed my computer slowing down significantly. Has anyone else experieced this?
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
0
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...

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.