且构网

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

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

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

如果您的本地构建成功而只是 TFS 构建失败,那么通常是由于 dll 引用路径问题.确保 Dll 被引用为项目文件 (.csproj) 中的相对路径.

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: fs_getSourcesassemblyabc.dll,请执行以下操作:

To add a relative reference in a separate directory, such as C: fs_getSourcesassemblyabc.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: fs_getsourcesmyfoldermyprojectmyproj.csproj

Find the *.csproj where this reference exist and open it in a text editor. Lets say your .csproj location is c: fs_getsourcesmyfoldermyprojectmyproj.csproj

编辑 <HintPath > 等于

Edit the < HintPath > to be equal to

....assemblyabc.dll

....assemblyabc.dll

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

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

希望这会有所帮助.