Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Website missing msshrtmi when built on and deployed from TFS

I'm trying to deploy to Azure Websites (Preview) from TFS (Preview). The build works and the website is deployed but when my code tries to access the Azure RoleEnvironment the website throws the following exception:

Could not load file or assembly 'msshrtmi, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I've tried all solutions proposed in the following thread with no luck. I think it has do to with the TFS.

I have tested this:

  • Reinstalled Azure SDK and Tools
  • Removed all PlatformTarget from projectfiles
  • Wrote post-build event to delete msshrtmi.dll
  • Targeted all assemblies to x64 (-> failed all unit tests on TFS, it seems to be x86, even if allowing x64 in .testsettings)

Could not load file or assembly 'msshrtmi' or one of its dependencies (Azure Table Storage Access)

I've ran out of ideas on how to troubleshoot this issue? Does anyone have any suggestions?

like image 279
Jonas Stensved Avatar asked Jun 27 '12 09:06

Jonas Stensved


2 Answers

I've encountered a similar issue in earlier versions of the SDK when doing some builds. My solution wasn't entirely intuitive. If I go through each of my build configurations and do a "Clean Solution" then go back to the build configuration I actually care about and do a build this issue goes away.

I have no explanation as to why this works, but after hours pulling my hair out, I was just happy to have a solution.

like image 114
knightpfhor Avatar answered Oct 27 '22 12:10

knightpfhor


After 7 hours of mindblowing trial and error I finally fixed this. The problem lay with having Microsoft Windows Azure tools for June 2012 together with Microsoft Windows Azure tools for November 2011.

The steps I followed:

  • Remove Microsoft Windows Azure tools For Visual Studio 2012 RC - June 2012
  • Install Microsoft Windows Azure tools for Visual Studio 2010 - June 2012 Edition
  • Remove Microsoft Windows Azure tools for Visual Studio 2010 - November 2011 Edition
  • Now re-open the project that was trying to be deployed
  • Visual Studio will try to convert all the November 2011 binaries to the June 2012 edition
  • Once this is successfully done, re-check all the Microsoft.WindowsAzure references to see if they are version 1.7.0.0
  • Publish to Azure!

Hope it helps someone, I'm so tired I'm not coding for the next 24 hours.

like image 20
SalGad Avatar answered Oct 27 '22 12:10

SalGad