Thursday, 19 March 2009

Accessing TFS programmatically result in a Common Language Runtime detected an invalid program.

I have written a small application which access TFS programmatically to carry out certain operation (I won’t go in detail about the application, everything worked fine on my local machine but when I deployed this application onto SYST Environment, my really sweet application was throwing following error (haven’t included the stacktrace though).

Error Details: InvalidProgramException: Common Language Runtime detected an invalid program.

Reading thru some of the forums indicated one of the possibility of this might be if server is running 64 Bit. In my case this was not a problem as my server is 32 bit. I was able to resolve this issue by installing VS2008TeamExplorer on the server. Not sure how this makes a difference as all required dll’s for accessing TFS programmatically is included in the BIN directory of application. If any of you have any further info on these lines please leave a comment.