Azure: Getting error in loading 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache'

0 votes

 I am working on a web app which interacts with TFS. When I upload my application to Windows Azure Cloud, I am getting this error message:

Server Error in '/' Application.
--------------------------------------------------------------------------------


Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' or one of its dependencies. An attempt was made to load a program with an incorrect format. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' could not be loaded.



WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Stack Trace: 



[BadImageFormatException: Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +123

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11568240
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +485
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +79
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +337
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700976
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4869205




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 

Kindly help me resolve this.

Mar 26 in Azure by sabby
• 4,350 points
37 views

1 answer to this question.

0 votes

The error is occurring because you are trying to use a 32-bit dll in a 64-bit Azure environment. You can resolve these issues by creating a start-up script with the below steps:

  • Copy below startup script to a text file and save as "setup.cmd" 
  • Then include this file into your web role project,set "copy local"=true 
  • Then open your ServiceDefinition.csdef below given startup command inside webrole tag
<webrole > --your webrole
    <Startup>
              <Task commandLine="setup.cmd" executionContext="elevated" />
          </Startup>
</webrole >

This is the start-up script:

%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/applicationPools /applicationPoolDefaults.enable32BitAppOnWin64:"True" /commit:apphost
answered Mar 26 by Prerna
• 1,940 points

Related Questions In Azure

0 votes
2 answers

In Azure powershell Select-AzureSubscription command fetching error: the subscription name doesn't exist

The problem you're having is that the ...READ MORE

answered Aug 16, 2018 in Azure by Priyaj
• 56,900 points
1,662 views
0 votes
2 answers
0 votes
1 answer

Is it possible to access performance counter in Microsoft Azure Web App?

No, it is not supported on Azure ...READ MORE

answered Jul 4 in Azure by Perry
• 17,020 points
33 views
0 votes
1 answer

I am getting a network related error saying "cannot connect to a server". need help here.

Actually i got the same error, it ...READ MORE

answered Apr 26, 2018 in Azure by null_void
• 3,220 points
75 views
0 votes
1 answer

Want to upload a blob file with huge size to azure in as little time as possible.

Microsoft Azure Storage Explorer is one of the ...READ MORE

answered Mar 27 in Azure by Prerna
• 1,940 points
48 views
0 votes
1 answer

How to set default Web page for a website on Microsoft Windows Azure?

This blog post should resolve your issue: http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-role-app-silverlight-asp-net-etc.aspx Look ...READ MORE

answered Mar 27 in Azure by Prerna
• 1,940 points
50 views
0 votes
3 answers

What is the job role of an Azure Developer?

Hi, Here are some job roles of an ...READ MORE

answered Jul 23 in Career Counselling by Gitika
• 25,340 points
106 views
0 votes
4 answers

What are the skill required for an Azure Developer?

Hi, The skills required for an Azure Developer ...READ MORE

answered Jul 23 in Career Counselling by Gitika
• 25,340 points
1,244 views
0 votes
1 answer

Getting an error when trying to authenticate using REST API Dynamics CRM with Azure AD.

Dynamics 365 has started to support Server-to-Server ...READ MORE

answered Apr 25 in Azure by Prerna
• 1,940 points
153 views
0 votes
1 answer

How to check if multiple files exist in Azure container?

foreach loop is the most efficient way though. ...READ MORE

answered Mar 4 in Azure by Prerna
• 1,940 points
205 views