We want to deploy a ASP.NET WebApi service to Azure Service Fabric.
The service uses a mathematical COM component (32bit) that will be registered on a regular machine with regsvr32.
The solution works perfectly on a local Service Fabric cluster (e.g Windows Server 2012 R2).
Unfortunately there is no managed dll available for that component and we do not want to rewrite the code all by ourselves.
So my question is, can we deploy this service to an Azure hosted Service Fabric?
And if yes, how?
How are you calling it on the local cluster - through PInvoke? A couple of ideas to help:
You could use COM Interop:
tlbimp YourComDll.dll /out: YourDotNetWrapper.dll
Then use YourDotNetWrapper.dll
from you Service Fabric service. You may be able to get away with "xcopy" style deployment of the COM component, i.e. include it as a resource in your project and have it copied to the output folder e.g. bin/Release
.
If it still needs to be registered, you can register it in code with Process.Start("regsvr32...") or via code (PInvoke) - thought you may need to elevate privileges on Service Fabric.
You would need a mechanism to register it only once to avoid spamming the registry. Maybe a Reliable Dictionary of [NodeName],[IsOurComRegistered]
, or just checking if it is registered before registering.
Good luck!
You can try installing this COM with regsvr32 via StartUp and see if that would work.
Here are some notes on Startup Tasks.