Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I thought I would quickly share my approach in case anyone ever needs to do that or something similar again, as the problems will be common to other native C++ libraries in Azure.</p> <p>The problem was to do with a number of things: Azure not having all the VC++ runtime dlls needed by Z3; the Z3 install not including its other dependencies in its bin; Silverlight RIA Services failing to compile if there are any 64bit dlls either in the solution or in the bin folder; Azure not running the 32bit version of the Z3 dll; Azure not having the F# runtime, etc..</p> <p>This is how I got it working:</p> <ol> <li><p>Abstract out an interface for the code that calls Z3 (In my case, having an IXxxAnalyzer interface in XxxAnalyzerCommon.dll)</p></li> <li><p>Don’t add the concrete F# implementation of this interface directly into the solution either as a reference, content, or resource. </p></li> <li><p>Instead, use a .NET zip library to package:</p> <pre><code> a. XxxAnalyzer64.dll (64bit version of the F# implementation of IXxxAnalyzer) b. XxxAnalyzerCommon.dll c. FSharp.Core.dll d. FSharp.PowerPack.dll e. Microsoft.Z3.dll (64bit version) </code></pre></li> <li><p>Add the zip as content to the web project</p></li> <li><p>Add the VC++ redistributable (64bit) vcredist_x64.exe as content to the web project</p></li> <li><p>Create an Azure startup task that silently installs the VC++ redist when its first deployed.</p></li> <li><p>Create an Azure Local Storage Resource in your role configuration</p></li> <li><p>At startup, extract the zip to the local storage (if it’s not already there)</p></li> <li><p>Use MEF (the Managed Extensibility Framework) to dynamically import the concrete IAnalyzer by using a DirectoryCatalog pointing at the local storage – so the project doesn’t need to have any direct reference or dependency on XxxAnalyzer64.dll.</p></li> </ol> <p>There was also a problem with the FSharp.PowerPack.dll strongly referencing an earlier version of FSharp.Core.dll, which I had to use an Assembly Redirect statement in the web.config to resolve.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload