观察构建具有传递性项目依赖? [英] Observe build with transitive Project Dependencies?

查看:151
本文介绍了观察构建具有传递性项目依赖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好:)我是相当新的C#/。NET和我有一个关于项目依赖的一些问题。

Hello :) I'm fairly new to C# / .NET and i have some questions regarding project dependency.

第一:我的情况。我有一个解决方案 - 我们称之为MyLibrary的 - 这有几个.dll文件输出的项目。该项目依赖彼此(如项目引用),也从一些外部库文件(.dll引用)。我确保该项目引用的外部引用的一个特定的副本。

First: my situation. I have a Solution - let's call it MyLibrary - which have several .dll-Output Projects. This projects are dependant from each other (as project references) and also from some external libraries (.dll-References). I ensured that the project references a specific copy of the external references.

现在我有第二个解决方案 - 所有MyApplication - 其中有一些上述库,项目和其他项目中。因此,所有的我自己的项目中引用彼此IVA项目引用。我已经建立了所有项目的基准设置为复制本地:真。

Now I have a second solution - MyApplication - which has some of the above Library-Projects and additional projects. So all of my own projects reference to each other iva project reference. I have set up all projects with the reference setting "Copy Local: True".

我现在的问题是,所有MyApplication抛出一个错误,指出该库项目的人都有不同的版本 - 这是奇怪的,因为如果我MyApplication的建设应该建立所有必需的项目

My Problem now is, that MyApplication throws an error saying that one of the library-projects has a different version - which is strange since if I build MyApplication it should build all required projects.

现在我的问题:

  • 如果我有项目C依赖于项目B而这又依赖于项目A,我需要引用项目A的项目C,即使项目C不从项目A.使用任何类型是否有解决方法吗?
  • 在我能得到它指出该项目是建立在一个干净的输出日志?从Visual Studio输出-登录我有麻烦羯羊不同的项目是重建,或只是已复制到目标文件夹
  • 是否有工具,其中读出*的.sln或* .csproj的文件,并直接表明我这assemblie引用该组件?
  • 正如我所说的,我已经包括从MyLibrary的MyApplication的几个项目,并设置在MyApplication的复制本地:真的MainProject的参考。如果我清理所有MyApplication(解决方案),它会删除从MyLibrary的目的地 - 文件夹中所有* .dll文件。我可以河畔preSS这种行为以某种方式(它应该只删除* .dll文件的来自所有MyApplication目的地文件夹)。

感谢由四个帮助。

PS:我来自德国,我的伽利略-boo​​k关于C#覆盖这个话题不是很好。是否有一些好的教程/书籍的直接和有关Visual Studio的项目管理功能?

P.S.: I'm from Germany and I have the "Galileo"-Book about C# which covers this topic not very good. Are there some good tutorials / books which are directly about the Project Management Functionality of Visual Studio ?

推荐答案

在回答了几个你的问题:

In answer a couple of your questions:

如果我有项目C依赖于   项目B这再次依赖于   A计划,我需要参考项目   A有项目C即使项目C不   使用任何类型的项目A.有   一个解决方法吗?

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 don't use any types from Project A. Is there a workaround for this?

我不认为这是真的一般。您只需要引用一个在B暴露了一些类型的从A例如,如果一个类B中从一个类继承于A则是,C需要一个因为C语言需要了解的基类。但是,如果B'隐藏'后面的所有A是自己的类/接口则C并不需要知道一个。

I don't think this is true in general. You will only need to reference A if B exposes some of the types from A. For example if a class in B inherits from a class in A then yes, C will need A since C needs to know about the base class. However if B 'hides' A behind all is own classes/interfaces then C does not need to know about A.

有没有工具,它读出   *的.sln或* .csproj的文件,并直接表明我这assemblie引用   其中装配?

Are there Tools, which read out the *.sln or *.csproj files and shows me directly which assemblie references which assembly?

您可以从组件的元数据直接获取这些信息。 反射是一个很好的工具。它是免费的,但现在看来,他们开始为它充电3天前(真可惜!)

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

关于我没那么熟悉的Visual Studio问题的其他两个问题。但总的来说,我很惊讶,你所得到的版本错误。你们是不是要使用强名称程序集?个人而言,我不会建议,除非你正在向公众提供这些组件。据这些组件都只是为了那么就真不该版本可言在自己的应用程序分离关注。所得应用将针对每个子项目的最新版本进行编译,并且当它改变每个子项目仅被编译

The other 2 questions about visual studio issues I'm not that familiar with. But in general I'm surprised you are getting the version error. Are you trying to use strong name assemblies? Personally I wouldn't advise that unless you are making these assemblies available to the public. It these assemblies are just for separation of concerns within your own application then there shouldn't really be versioning to speak of. The resulting application will be compiled against the latest version of each sub-project, and each sub-project will only be compiled when it changes.

在任何情况下,你必须某处指定您需要一个特定的程序集的特定版本(在一个app.config / web.config中可能)。可你刚才从这个配置中删除版本的约束?

In any case you must somewhere be specifying that you require a specific version of a particular assembly (in an app.config/web.config probably). Can you just remove the version constraint from this configuration?

这篇关于观察构建具有传递性项目依赖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆