将程序集部署到构建机器上的 GAC 的最佳方法
我们的单元测试期望在 GAC 中找到某个程序集。我想知道将程序集放入 TFS2010 自动构建的构建服务器上的 GAC 中的最佳方法是什么? 将构建后事件与 gacutil /i 一起使用是个好主意吗? 有更好的选择吗?
Our unit tests expect to find a certain assembly in the GAC. I am wondering what is the best way to put the assembly in the GAC on the build server that is part of TFS2010 automated build?
Is it a good idea to use a post build event with gacutil /i?
Are there better alternatives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的单元测试是否期望 GAC 中的 DLL 还是仅可用于 .NET 程序集探测?如果实际上是后者,为什么不使用 [DeploymentItem()] 属性并将程序集复制到测试文件夹,然后由 .NET 通过探测找到?另一种选择是在测试 DLL 的配置文件中使用 HintPath。
Do your unit tests expect the DLL in the GAC or just available to .NET assembly probing? If it's actually the latter, why don't you use [DeploymentItem()] attributes and have the assembly copied to the test folder and then found by .NET via probing? Another option would be to use a HintPath in your test DLL's config file.