1

Is it possible to use Code Numerics on Azure just for some computation like standard deviation and so on, not using its distributed abilities and bypassing HPC? I am testing an MVC Web Role with some strong math and charting, I added references to the Cloud Numerics assemblies and the whole thing works in emulator (just some computation, no distributed stuff) but when I delpoy to Azure it reports dependencies problems with Cloud Numerics dlls? I would really appreciate some advice. (I know it would be better just to use some standard math library for that but I really need to know if it is possible this way). I have initially thought that this might be the architecture problem: whole project is AnyCpu (it can only be AnyCpu or x64 as Azure allows only these two confs) and some of the CLoud Numerics libraries are compiled for x64. But my dev machine is x64 win 7 and I repeat: IT WORKS IN EMULATOR, but not in the cloud.

Here are the exception details:

Could not load file or assembly 'Microsoft.Numerics.DistributedDenseArrays.DLL' or one of its dependencies. The specified module could not be found.

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.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Numerics.DistributedDenseArrays.DLL' or one of its dependencies. The specified module could not be found.

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.

Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'Microsoft.Numerics.DistributedDenseArrays.DLL' or one of its dependencies. The specified module could not be found.]
   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.Numerics.DistributedDenseArrays.DLL' or one of its dependencies. The specified module could not be found.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11567856
   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.Numerics.DistributedDenseArrays.DLL' or one of its dependencies. The specified module could not be found.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700592
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4868789

The mentioned dll Microsoft.Numerics.DistributedDenseArrays is naturally included as a copy always along with other dependencies as stated in dependency walking tool.

Tobiasz
  • 1,059
  • 1
  • 12
  • 29

3 Answers3

2

If I stumble upon this kind of problems my first check is if the refercened libraries have the property copy local = true. The next step is to implement en configure diagnosticts If you only deploy to one instance for development and testing you can use RDP to check the eventlog.

Reading Introducing Microsoft Codename “Cloud Numerics” from SQL Azure Labs in the Prerequisites chapter the Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) is needed. This is not standerd implemented on the basic VM that is provided by Windows Azure. The package kan be installed on your instace in a star up task. Make sure that the msi is started in silent mode (no user interaction needed).

Michiel

  • Thanks for the answer. That also has been my first approach: I have used a dependency walker tool, I have added all the possible missing references, everything double checked to be Copy Always, still no good. However, I have followed your tip about Visual C++ Redist and added the installation as a startup task (even though I have added a reference to Microsoft.ViusalC as a Copy Always, but maybe other assemblies from redist are missing). I have checked through RDP, it does install successfully in silent, it is visible on the installed programs list, but still no luck. – Tobiasz May 09 '12 at 09:53
2

I would suggest getting a Fusion log:

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].

Then you can see where it is trying to load the file from and figure out exactly what the problem is. If you are unable to determine from that, post those details here so we can look at it.

Tom
  • 1,611
  • 10
  • 11
0

OK, problem solved.

Solution: There was sth. missing from Cloud Numerics (one more native library from Cloud Numerics install dir) and, what is more interesting: there was an extra DevExpress Printing.Core library reference in Web.config while it was not added as a reference to my project. Why it is more interesting? Mainly because I had to use ProcMon on my WebRoles to acknowledge the fact and after I filled the blank I got a far more useful error stating which precise library from Cloud Numerics is missing in my deployment.

Conclusions: ProcMon is a very useful tool, the RDP for Azure VMs is priceless.

Tip: if you ever try to deploy a project on Azure that utilizes CN library do not forget to add msmpi.dll from Microsoft HPC Pack as a CopyAlways content, also pay attention to what type of msmpi.dll you are referencing (x32 or x64).

Thank you guys, every answer brought me closer to the solution. The credit goes also to Cloud Numerics Lab team, especially to Roonie Hoogerwerf.

Tobiasz
  • 1,059
  • 1
  • 12
  • 29