警告无法解析构建服务器上的 Moles dll

发布于 2024-12-25 07:31:11 字数 687 浏览 2 评论 0原文

我们在解决方案中使用摩尔 0.94 进行一些测试。然而,每次第一次编译时,构建服务器都会发出一些警告:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference. 
Could not locate the assembly "XXX.Moles, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL". 
Check to make sure the assembly exists on disk. 
If this reference is required by your code, you may get compilation errors.

我的理解是,构建服务器将在开始构建之前尝试解析测试项目的所有引用,如果找不到moles dll在moles assembly文件夹下(因为第一次它是空的),它会生成类似上面的警告。

但是当msbuild开始构建这个测试项目时,会生成mole程序集并将其复制到moleassemblies文件夹中,因此不会出现错误。

综上所述,第一次构建会部分成功,下次构建会完全成功。

我们试图在构建服务器上不出现任何警告。有什么方法可以消除构建服务器上的此警告吗?

We are using moles 0.94 for some tests in our solution. However, every time it gets first compiled, the build server will raise a couple of warnings:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference. 
Could not locate the assembly "XXX.Moles, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL". 
Check to make sure the assembly exists on disk. 
If this reference is required by your code, you may get compilation errors.

My understanding is that the build server will try to resolve all the references of the test project before starting to build, and if it cannot find the moles dll under the molesassembly folder (because in the first time, it's empty), it will generate a warning like the above.

But when msbuild starts to build this test project, the mole assemblies will be generated and copied into the moleassemblies folder, so it won't turn into an error.

In summary, for the first time, the build will partially succeed and the next time build will fully succeed.

We are trying not to have any warnings on the build server. Is there any way we can eliminate this warnning on the build server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔一刀 2025-01-01 07:31:11

我们将所有第 3 方程序集存储在项目根文件夹的 Assemblies 文件夹中。我们任何项目中使用的所有第 3 方程序集均从此位置引用。 Assemblies 文件夹包含在 TFS 中。

看起来您正在引用输出文件夹中的 XXX.Moles 程序集,而不是某些常见(程序集)文件夹。尝试更新您的引用以使用程序集文件夹中的第 3 方库,而不是测试项目的输出文件夹。

编辑:尝试添加检查 XXX.Moles 程序集是否存在到参考标记中,例如:

<Reference Condition="Exists('..\molesassemblies\XXX.Moles.dll')" Include="XXX.Moles.dll">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\molesassemblies\XXX.Moles.dll</HintPath>
</Reference>

We have all 3rd party assemblies stored in the Assemblies folder in the project's root folder. All 3rd party assemblies used in any of our projects are referenced from this location. Assemblies folder is included in the TFS.

It seems like you are referencing XXX.Moles assemblies from the output folder instead of some common (Assemblies) folder. Try to update your references to use 3rd party libraries from Assemblies folder instead of output folder of your test project.

EDIT: Try to add check if XXX.Moles assembly exists into Reference tag e.g.:

<Reference Condition="Exists('..\molesassemblies\XXX.Moles.dll')" Include="XXX.Moles.dll">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\molesassemblies\XXX.Moles.dll</HintPath>
</Reference>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文