C # Custom applications that access TFS

We have created our own application for internal use, which refers to TFS. For this, we use Microsoft libraries (eg. Microsoft.TeamFoundation.dll).

When this application is deployed to PCs that already have Team Explorer or VS installed, everything is in order. When it is deployed to PCs that do not have this installed, it fails.

We include all the necessary DLLs, but the error we get is "Runtime common language detected and invalid program." The error occurs on a moderately harmless line:

TeamFoundationServer myServer = new TeamFoundationServer("ourserver.ourdomain.com"); 

Interestingly, the popular TFSAdmin tool (when you throw the necessary DLLs into the exe directory) gives the same error.

I also note that many other custom applications that access TFS (e.g. http://hinshelwood.com/tfsstickybuddy.aspx ) also require Team Explorer or VS to be installed to work.

Obviously, the DLL is not enough, and there is some kind of magic that occurs when these settings occur. Does anyone know what this is? Does anyone know how to do magic?

+4
source share
2 answers

The “officially supported” way of writing an application using the TFS object model is to have Team Explorer installed on this computer. This is especially important for maintenance — that is, make sure that when the service pack for VSTS is applied to the client machine, then the TFS API is also updated. There are no redistribution rights for the TFS API, so they cannot be sent with your application.

BTW. Also note that if you are writing an application using TFS OM, be sure to compile it as "X86" and not "Any processor." All TFS API assemblies are marked as X86, but if the application is marked “Any processor” and then on the x64 machine, it will be loaded with a 64-bit CLR, but when the time comes to dynamically load the TFS assemblies, it will fail.

Good luck

Martin.

+9
source

Try this list:

http://geekswithblogs.net/jjulian/archive/2007/06/14/113228.aspx

And also trying to put them in the GAC. This may be a security trust issue - assemblies in the GAC get a higher level of CAS.

+1
source

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


All Articles