Unable to find namespace - create using TFS

I have problems with TFS. He will not build my project because

Cannot find name of type or namespace Newtonsoft (do you miss using directive or assembly reference?)

I tried adding it via nuget, but still I get this error. I have other projects that work great when I add this DLL via nuget. In addition, the local assembly of this project is successful. I created a new folder inside the solution, and then put the dll in it, and I referenced it.

+6
source share
1 answer

If your local build is successful, and only the TFS build does not work, then this is usually due to a DLL reference path problem. Make sure the Dll is referenced as the relative path in the project file (.csproj).

To add a relative link to a separate directory, for example C: \ tfs_get \ Sources \ assembly \ abc.dll, do the following:

Add the link in Visual Studio by right-clicking the project in Solution Explorer and selecting Add Link.

Find * .csproj where this link exists and open it in a text editor. Let's say your .csproj location is c: \ tfs_get \ sources \ myfolder \ myproject \ myproj.csproj

Edit <HintPath> will be equal

.. \ .. \ Assembly \ abc.dll

This assembly will work correctly under the assumption that the folders (assembly, folder) in the source folder exist in TFS.

Hope this helps.

+7
source

Source: https://habr.com/ru/post/951762/


All Articles