1

I'm working with two solutions, solution_1(incl. project_1 and project_2) and solution_2(incl. project_3), where I keep getting feature requests from users to add functionality in project_3 in solution_2. The reason why I have to solutions is that another programmer needs to be able to add functionalities into project_3 and release this, but I don't want him to access the project_1. When I want to release the new feature I have to build and release projects in both solutions, but I've only made changes in project_3, so this project should be the only one released.

As for now, project_1 has an reference to the assembly project_3, where the property Copy to local is FALSE but this results in this error:

Assembly 'project_3.dll' must be strong signed in order to be marked as a prerequisite. 

Whenever I build project_3 the output path is set to a folder which is visible to both solutions.

My point is that I don't want to keep building and releasing project_1 in solution_1 in which I haven't made any changes, but only build and release project_3 in solution_2, which actually has changes in it, for the new features to be available for the users.

4

1 回答 1

2

一个项目可以在多个解决方案中。您可以简单地将project_3添加到solution_1,这样当项目更改时,您只需重新编译一个解决方案。

请注意,如果您这样做,您应该注意一些问题;主要是常识性的东西,但仍然:

  • 其他解决方案中的重构工具不知道这个解决方案。换句话说,它们可能会破坏依赖关系(例如,如果对解决方案_2 进行了重构,解决方案_1 对项目_3 的依赖关系(两者都存在)是有问题的)。
  • 最好不要同时打开两个解决方案,以避免覆盖您自己的更改。
  • 尽管 VS.NET 支持这一点,但它并没有特别努力使它变得简单。因此,如果您的项目文件包含对解决方案范围变量的引用,您需要手动确保这没问题(例如,如果您有任何自定义构建步骤)
  • 特别是,nuget 默认将其包存储在解决方案级别的 /packages 文件夹中。如果一个项目在不同的解决方案中,这个包文件夹可能在不同的位置(不同的相对路径),这将存储在项目文件中并导致问题。我会避免 nuget 文件夹的不同(相对)路径。

您不应该引用 project_3 创建的程序集,您应该在解决方案 1 中包含现有项目 3,并引用项目本身。(这与强签名无关 - 这是一个不同的错误)。

于 2013-01-19T11:10:20.233 回答