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

Response to C++ Warning C4945

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 gets more to the root of the problem than the response on the thread itself. I am posting this message hoping whoever posted the original question will see it:

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.
Dec 14 '07 #1
0 2521

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Adam B | last post by:
Hello. I'm writing an aspx page that reads a file from disk and writes the file out through the Response.WriteBinary() method. This allows me to support security and custom reports for various...
0
by: Adam B | last post by:
Hello. I'm writing an aspx page that reads a file from disk and writes the file out through the Response.WriteBinary() method. This allows me to support security and custom reports for various...
10
by: Urs Eichmann | last post by:
If I have two webforms, form1.aspx and form2.aspx, and I want to do a Response.Redirect from form1 to form2, I can write Response.Redirect("form2.aspx") However, if somebody changes the name...
1
by: Cindy H | last post by:
Hi I used the code below to automatically open a pdf file when the user clicks on a menu option. It works great on local machine, but when I uploaded it to hosting site and then tried it, I...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
5
by: twiggy182 | last post by:
Hi, I really need you help because I'm not very familliar with ASP and I could not find any solution to my problem. To put you in situation, I have a CGI to which I send a file name, and that...
3
by: guillermojco | last post by:
Hi, I've got an ASP.NET page that returns XLS, DOC, PDF and other files from binary fields in a database. The problem is that MS-Excel 2007 shows a security warning when trying to open the...
4
by: =?Utf-8?B?S2V2aW5NdXJwaHlSSkxH?= | last post by:
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...
3
by: guillaume.braux | last post by:
Hello, I am running WS2008 + IIS7 + FASTCGI + ZendCore. I have not modified the default ZendCore php.ini configuration file. Actualy, any kind of PHP error, warning or notice gives me...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.