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