1

I have a program in c# that is using WatiN. It compiles and runs well in my development windows 7. However when I copy the program to windows 2012 datacenter in azure, it throws below exception when the application tries to start an instance of internet explorer(which exists in windows 2012 datacenter):

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForCompleteOrTimeout() at WatiN.Core.IE.WaitForComplete(Int32 waitForCompleteTimeOut) at WatiN.Core.Browser.GoTo(Uri url) at WatiN.Core.IE.FinishInitialization(Uri uri)

I am kind of lost on this exception, what is missing on the server?

Thank.

Henry
  • 384
  • 1
  • 9
  • 22
  • 1
    This question on SO may help: http://stackoverflow.com/questions/2068159/could-not-load-file-or-assembly-microsoft-mshtml-strong-name-validation-fai – Brian Ogden Sep 22 '13 at 04:30

1 Answers1

3

It is a standard interop assembly that is installed in the GAC on any dev machine. Not exactly sure how it got there, most likely it is the VS installer that put it there. But it won't be in the GAC on that Azure node.

Open the References node of your project and select the Microsoft.mshtml entry. Change the Copy Local property to True. Rebuild and you'll now have a copy of the assembly in your build directory. Copy it along with the rest of your executables to the Azure node.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536