Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An attempt was made to load a program with an incorrect format. Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader

I'm writing an app that gets bugs from TFS. When I run this program on my machine with visual studio installed Running Windows 8 it works fine. When I run this program on one of my virtual machines Running Server 2008 R2 and Windows 7 With the Visual Studio Agent installed it throws the following exception

Error occured: Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. An attempt was made to load a program with an incorrect format.
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal()
   at AutomationEntities.TFSManager.GetBugsFromTestCase(Int32 testCaseID)
   at AutomationEntities.ReportManager.GetBugStringFromTestCases(String testCaseString, String status)
   at AutomationEntities.ReportManager.InsertOrUpdateReport(String agentMachineName, String product, String versionName, String serverURL, String testCategory, String testName, String testNumber, String status, DateTime lastModifyTime, String errorMessage, Nullable`1 elapsedTime)
   at AutomationManager.XMLHandlerReport.AddItemToReportDatabase(String agentMachineName, String product, String version, String serverURL, String testCategory, String testName, TEST_STATUS testStatus, String errorMessage, String testNumber, String elapsedTime)
   at AutomationManager.ReportManager.ReportIndividualTestItem(TestData pendingTest, String testName, TEST_STATUS testStatus, String errorMessage, String resultsFileWPath)
   at AutomationManager.Program.Main(String[] args)

All of my machines run 64-bit Windows

I have no idea. The Dll listed is in the same folder as the app and it is version 11. Any ideas on what I'm missing?

like image 645
Jordan Davidson Avatar asked Sep 12 '13 16:09

Jordan Davidson


2 Answers

I had this same problem in an ASP.NET web application. I solved it by enabling Enable 32-bit Applications for the IIS application pool.

like image 158
Jay Douglass Avatar answered Oct 19 '22 13:10

Jay Douglass


It ended up being an issue with the GAC. I just made all of my references build with the dlls instead of assuming they were in the GAC

UPDATE:

If you look into the properties of a reference there is a build property. set all of the problem DLL's to copy on build.

like image 1
Jordan Davidson Avatar answered Oct 19 '22 13:10

Jordan Davidson