且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到命名空间-使用TFS构建

更新时间:2022-06-23 06:04:55

如果本地构建成功,而TFS构建失败,则通常是由于dll参考路径问题所致.确保在项目文件(.csproj)中将Dll引用为相对路径.

If your local build is successful and just the TFS build is failing then it is usually due to dll reference path issue. Make sure that the Dll is referenced as a relative path in the project file (.csproj).

要在单独的目录(例如C:\ tfs_get \ Sources \ assembly \ abc.dll)中添加相对引用,请执行以下操作:

To add a relative reference in a separate directory, such as C:\tfs_get\Sources\assembly\abc.dll, do the following:

通过在解决方案资源管理器中右键单击项目,然后选择添加引用",在Visual Studio中添加引用.

Add the reference in Visual Studio by right clicking the project in Solution Explorer and selecting Add Reference.

找到此引用所在的* .csproj,然后在文本编辑器中将其打开.假设您的.csproj位置为c:\ tfs_get \ sources \ myfolder \ myproject \ myproj.csproj

Find the *.csproj where this reference exist and open it in a text editor. Lets say your .csproj location is c:\tfs_get\sources\myfolder\myproject\myproj.csproj

编辑< HintPath>等于

Edit the < HintPath > to be equal to

.. \ .. \ assembly \ abc.dll

..\..\assembly\abc.dll

假定源文件夹下的文件夹(程序集,myfolder)在TFS中存在,此构建将正常工作.

This build will work properly with the assumption that the folders ( assembly, myfolder) under the sources folder exist in TFS.

希望这会有所帮助.