Is this the correct way to resolve warning C4945 (symbol already imported from another assembly)?

I have a .net solution (written in C ++ / CLI) that references some .dll projects as follows:

MainProject->ProjectA->ProbjectB
MainProject->ProjectB

I initially referred to both ProjectA and ProjectB from MainProject, which gave me warnings, as mentioned above.

I can remove the warnings by removing the link to ProjectB from ProjectMain, but this makes it less obvious that MainProject uses ProjectB. Is this the right way to get rid of warnings?

+3
source share
5 answers

, , node - . , , , .

+2

, .

ReSharper, ProjectMain → .

+1

, , .

  • CSCommon #
  • CS1 #, CSCommon
  • CPP1 ++, CSCommon
  • CPPMain, CPP1

, C4945.
outputh, .

+1

, . , : "Project B" ( ). , , .

0

, , , .

. fooobar.com/questions/517636/...

Use Dependencies in Build=false .

The fact is that you should have all the links that the code itself uses as direct links in the project itself, but the parameter Use Dependencies in Build=TRUEinterferes with this, since it also pulls transitive links, causing conflicts if you also have direct links. (At least on my VS2005)

0
source

Source: https://habr.com/ru/post/1748813/


All Articles