I've hooked up topshelf to a x86 project - where I reference 32bit native com dll's.
Running as a console app works fine.
When I install & start as a service, I receive assembly binding errors. Below is the resulting portion from fuslogvw:
LOG: Assembly download was successful. Attempting setup of file: D:\Projects\bin\Debug\RmRms_1_3_n_1.dll
LOG: Entering run-from-source setup phase.
ERR: Error extracting manifest import from file (hr = 0x80131018).
ERR: Run-from-source setup phase failed with hr = 0x80131018.
ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.
It finds the DLL, but cannot load it. I should note that this DLL was compiled under .NET 2.0, and I have the following in my app.config:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup>
useLegacyV2RuntimeActivationPolicy was required for successful execution as a console app.
I've checked dependency walker (there are some issues reported & I've copied in the remaining dependencies) and tried copying / moving the DLL's into locations such as System32 based on other posts I have found with the same error. That largely stopped the binding errors, but the same error was reported from my service in all cases:
System.IO.FileLoadException: Could not load file or assembly 'Rimage.Rapid.Api.dll' or one of its dependencies. Exception from HRESULT: 0xE06D7363
File name: 'Rimage.Rapid.Api.dll'
Rimage.Rapid.Api.Dll depends on the RmRms_1_3_n_1.dll reported by fuslogvw.
Any tips?
Brett