473,322 Members | 1,417 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,322 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 5549
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.