TFS构建服务器 - 项目参考问题 [英] TFS Build Server - Project Reference Problem
问题描述
我在TFS上为项目创建了构建定义。该项目可以在IDE上成功编译,但在使用TFS Build Agent编译时失败。问题如下;
$
项目B在项目A中引用。有些代码块包括"using namespace ProjectB.Interfaces;"。线。它会出现以下错误;
App_Start \ClassX.cs(16,19):错误CS0234:命名空间"App.ProjectB"中不存在类型或命名空间名称"Interfaces"(您是否缺少程序集引用?)[C:\ TFSBuildAgent \\ \ t \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ):错误CS0234:命名空间"App.ProjectB"中不存在类型或命名空间名称"Interfaces"(您是否缺少程序集引用?)[C:\ TFSBuildAgent\agent \_work\4 \ s\APP\ProjectA\ProjectA.csproj]
我检查了.csproj文件中的项目引用ProjectA。看起来好了。
< ProjectReference Include =" .. \ ProjectB\ProjectB.csproj">
&NBSP; &NBSP; < Project> {fw53d329c-f6ert47b-49aw324e}< / Project>
&NBSP; &NBSP; <名称> ProjectB< /名称>
&NBSP; < / ProjectReference>
你能帮忙吗?我在帖子中详述的情况?是否有任何列表要检查此类错误?
嗨提问者,
感谢您在这里冒充。
由于您在项目A中引用项目B,我建议您可以尝试在.csproj中使用hintpath部分来帮助TFS查找项目B.有关详细信息,请参阅以下链接:
http://bartwullems.blogspot.com/2013/03/visual-studio-reference-different-dll .html
之后,请尝试运行构建并再次检查结果。
最好的问候
Hi,
I've created a build definition for a project on TFS. The project can be compiled on IDE successfully, but it fails when compiled with TFS Build Agent. The problem is as follows;
Project B is referenced in Project A. There are code blocks which include "using namespace ProjectB.Interfaces;" line. It gives the following error;
App_Start\ClassX.cs(16,19): error CS0234: The type or namespace name 'Interfaces' does not exist in the namespace 'App.ProjectB' (are you missing an assembly reference?) [C:\TFSBuildAgent\agent\_work\4\s\APP\ProjectA\ProjectA.csproj]
App_Start\ClassY.cs(22,19): error CS0234: The type or namespace name 'Interfaces' does not exist in the namespace 'App.ProjectB' (are you missing an assembly reference?) [C:\TFSBuildAgent\agent\_work\4\s\APP\ProjectA\ProjectA.csproj]
I've checked the project references in .csproj file of ProjectA. It seems Ok.
<ProjectReference Include="..\ProjectB\ProjectB.csproj">
<Project>{fw53d329c-f6ert47b-49aw324e}</Project>
<Name>ProjectB</Name>
</ProjectReference>
Could you plase help for the situation I detailed in the post ? Is there any list to be checked for this type of error ?
Hi questioner,
Thank you for posing here.
Since you reference project B in project A, I suggest that you could try to use hintpath section in your .csproj to help TFS to find the project B. For more information, you could refer to the following link:
http://bartwullems.blogspot.com/2013/03/visual-studio-reference-different-dll.html
After that, please try to run the build and check the result again.
Best Regards
这篇关于TFS构建服务器 - 项目参考问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!