.Net 部署项目检测到的依赖关系神奇地未被排除
我有一个 Visual Studio 2005 .NET 解决方案,它有 20 多个子项目,其中包括一个部署项目。 VS2005 .NET 部署项目有许多检测到的依赖项,这些依赖项已被手动排除并手动添加了更正值。
然而,有时,这些检测到的依赖项会神奇地取消排除,这会在构建时触发警告: 警告:两个或多个对象具有相同的目标位置 ('[targetdir]\')
导致检测到的依赖关系不被排除的触发器是什么? 部署解决方案是否可以将其警告视为错误,以便夜间构建不会继续进行?
I have a Visual Studio 2005 .NET solution that has 20+ sub projects including a deployment project. The VS2005 .NET deployment project has a number of detected dependences, that have been manually excluded and corrected values manually added in.
Sometimes however, these detected dependencies get magically un-excluded, which triggers a warning on the build:
WARNING: Two or more objects have the same target location ('[targetdir]\')
What is the trigger that causes a detected dependency to be un-excluded? Can deployment solutions have their warnings treated as errors so the nightly build won't proceed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也遇到过同样的问题,并处理了大约一年,然后放弃并转向 WiX。 我必须“双重构建”我的构建也没有帮助,因为 VS2005 的 MSBuild 不适用于部署项目。
无论如何,您可能需要考虑安装 WiX 之类的东西。
I have had that same issue and dealt with it for about a year before giving up and moving over to WiX. It also did not help that I had to 'double-build' my builds because MSBuild for VS2005 will not work with deployment projects.
Anyway, you may want to consider something like WiX for your installs.
当依赖项目在依赖 DLL 上设置了“复制本地”时,就会发生这种情况。 部署/设置项目将 DLL 的源和副本列为依赖项。
It happens when the dependent project has "Copy Local" set on a dependent DLL. The deployment/setup project has both the source and the copy of the DLL listed as a dependency.
好吧,这更像是一个黑客而不是任何东西否则:)
您通常在 Visual Studio 下有 2 个选项:
a) 排除重复的 DLL
或
b) 将复制的 DLL 的 Condition 属性设置为不同的值。
问题是,使用这两种方法,您仍然会像以前一样神奇重置它们并收到警告。
对我们有用的是以下解决方案:
a)转到您的安装项目并创建a 自定义文件夹
b) 将自定义文件夹的 DefaultLocation 属性设置为与您需要放置这些 DLL 的位置相同。 即对于 ASP.NET 应用程序,该值为 [TARGETDIR]\bin
c) 然后将所有重复的 dll 拖放到此文件夹中,现在您应该不会收到任何警告。
就是这样。 您应该不会收到有关这些 dll 的警告,如果您有任何额外的,只需将它们拖到此文件夹中即可。
希望这可以帮助。
——康斯坦丁诺斯
Ok this is more of a hack than anything else :)
You normally under visual studio have 2 options:
a) Exclude the duplicated DLLs
or
b) Set the Condition property of your duplicated DLLs to something different.
Problem is that with both of these approaches, you are still gonna have them magically reset and get the warning like before..
What worked for us is the following solution:
a) Go to your setup project and create a Custom Folder
b) Set the DefaultLocation property of your custom folder to be the same as the one you need those DLLs to be placed. ie for ASP.NET applications the value is [TARGETDIR]\bin
c) Then drag and drop ALL the duplicated dlls into this folder and you should get no warnings now.
That's it. You should get no warnings for those dlls, if you have any extra just drag them into this folder.
Hope this helps.
-Konstantinos
如果您在同一个项目中使用多个开发环境,则此处对检测到的依赖项刷新的讨论可能会解释该行为:
http://www.xmission.com/~legalize/msi/known-bugs-2003.html
The discussion of detected dependency refreshes here may explain the behavior if you're using multiple development environments with the same project:
http://www.xmission.com/~legalize/msi/known-bugs-2003.html