native assembly binding failure

449 views
Skip to first unread message

Brett

unread,
Sep 18, 2015, 8:23:21 AM9/18/15
to topshelf-discuss
Hi,

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

Dru Sellers

unread,
Sep 18, 2015, 10:32:08 AM9/18/15
to topshelf...@googlegroups.com
That it runs as a console app is a good sign that the issue is not topshelf.

Next thing I would test is running it as a console as the user that the service runs as.

-d


--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brett

unread,
Sep 18, 2015, 5:31:06 PM9/18/15
to topshelf-discuss
Hi Dru,

Console and service are running as the same domain user (bumped to local admin to ensure there's no permission issues).

B

Brett

unread,
Sep 18, 2015, 7:44:15 PM9/18/15
to topshelf-discuss
OK, not a topshelf issue, reverting to a standard windows service shows the same issue.

Dru Sellers

unread,
Sep 19, 2015, 11:00:17 AM9/19/15
to topshelf...@googlegroups.com
+1 i suspected it would be. Curious to see what you find.

-d
Reply all
Reply to author
Forward
0 new messages