在编译时将引用路径从 GAC 更改为文件夹
我有一个依赖于一些第三方库的项目。这些程序集已在 GAC 中注册。到目前为止一切正常。 但是,当在构建服务器上构建项目时,第 3 方程序集不在 GAC 中,而是在一个额外的文件夹(称为 external)中,该文件夹也在构建服务器使用的 SVN 存储库中。
由于 MSBuild 找不到这些程序集,构建将失败。有没有办法告诉构建服务器上的 MSBuild 使用此文件夹中的程序集而不是 GAC?
I have a project that depends on some 3rd party libraries. These assemblies are registered int the GAC. Everythings works fine so far.
But when building the project on the build server, the 3rd party assemblies are not in the GAC, but in an extra folder (called external) that is also in the SVN-repository the build server uses.
The build will fail due to the fact that MSBuild can't find these assemblies. Is there a way to tell MSBuild on the buildserver to use the assemblys from this folder instead of the GAC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最佳实践是不在构建时引用来自 GAC 的第 3 方程序集。相反,从公共源代码管理文件夹引用所有第 3 方程序集。
如果您使用编辑器打开项目,理想情况下您将为每个第 3 方参考提供一个
HintPath
。 IE:The best practice is NOT to reference 3rd-party assemblies from the GAC on build time. Instead, have all 3rd-party assemblies referenced from a common source controlled folder.
If you open the projects with an editor, ideally you will have a
HintPath
for each 3rd-party reference. I.e:这应该可以工作
相关位将是c的“ReferencePath”参数:)
This should work
The relevant bit would be the 'ReferencePath' parameter ofc :)