Watch the construction with transitional dependencies of the project?

Hi :) I am new to C # /. NET and I have some questions regarding project dependency.

First: my situation. I have a solution - call MyLibrary, which has several .dll-Output projects. These projects depend on each other (as links to projects), as well as on some external libraries (.dll-References). I ensured that the project refers to a specific copy of the external links.

Now I have a second solution - MyApplication - which has some of the above Library projects and additional projects. Thus, all my own projects refer to a link to another iva project. I created all projects with the reference parameter "Copy local: True".

Now my problem is that MyApplication gives an error message stating that one of the project libraries has a different version - which is strange, because if I create MyApplication, it must collect all the necessary projects.

My questions now:

  • If I have Project C, which depends on Project B, which again depends on Project A, I need to reference Project A in Project C, even if Project C does not use any types from Project A. Is there a workaround for this ?
  • Can I get a clean output log where it indicates which project is created when? From Visual Studio Output Log I am having problems with the fact that the project is "rebuilt" or simply copied to the destination folder.
  • Are there tools that read * .sln or * .csproj files and show me which assembly refers to this assembly?
  • As I said, I included several projects from MyLibrary in MyApplication and set the MainProject links in MyApplication to "Copy local: True." If I clear MyApplication (solution), it removes all * .dll from the MyLibrary-Destination-Folder folder. Can I somehow refuse this behavior (it should remove only the DLL files from the MyApplication-destination folder).

Thank you four for your help.

PS: I am from Germany and I have a β€œGalileo” -Book about C #, which covers this topic not very well. Are there any good tutorials / books that directly relate to Visual Studio project management functionality?

+3
source share
1 answer

In response to a couple of questions:

If I have Project C, which depends on Project B, which again depends on Project A, I need to specify Project A in Project C, even if Project C does not use any types from Project A. Is there a workaround for this?

I do not think this is true in general. You will only need to reference A if B provides some types from A. For example, if a class from B inherits from a class in A, then yes, C will need A, since C needs to know the base class. However, if B 'hides' A behind everything - these are their own classes / interfaces, then C does not need to know about A.

Are there tools that read * .sln or * .csproj and show me which assembly links which assembly?

You can get this information directly from assembly metadata. Reflector is a great tool for this. It was free, but it looks like they started charging for it 4 days ago (bummer!)

Other 2 questions about visual studio issues I am not familiar with this. But overall, I am surprised that you are getting a version error. Are you trying to use strong name assemblies? Personally, I would not advise if you make these meetings available to the public. These assemblies are intended only to separate problems in your own application, then in fact there should be no truth. The resulting application will be compiled against the latest version of each subproject, and each subproject will be compiled only after changing it.

In any case, you should specify somewhere that you need a specific version of a specific assembly (probably in app.config / web.config). Can you just remove the version restriction from this configuration?

+4
source

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


All Articles