Fusion Log Assembly Binder Error - Bind result: hr = 0x1. Incorrect function

5

I am trying to get to the bottom of a strange behavior on one machine. I have a trivial console application that will run interactively, but when I invoke it via WMI, it will start and exit immediately.

I enabled the Fusion log, since Procmon was unrevealing. I see the following error:

*** Assembly Binder Log Entry (31-01-2015 @ 19:22:51) *** 

The operation was successful. 
Bind result: hr = 0x1. Incorrect function. 

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll 
Running under executable C:\CMCBOOTSTRAP\Cmc.Installer.Agent.Console.exe 
--- A detailed error log follows. 

BEGIN : Native image bind. 
END : Incorrect function. (Exception from HRESULT: 0x00000001 (S_FALSE))

What is the cause for "incorrect function"? What else can I look at to determine why this application effectively dies on startup via WMI?

And I mean trivial...

class Program
{
    static void Main(string[] args)
    {
        Thread.Sleep(30000);
    }
}

Environment is Windows Server 2012 R2 and .NET 4.5.

c#
.net
wmi
fusion
asked on Stack Overflow Jan 31, 2015 by Mark Richman

2 Answers

12

This is an entirely normal mishap, you got it from Fuslogvw.exe by selecting the "Native Images" radio button in the Log Categories setting. Readily reproducible on my own machine as well, I see many of them.

The actual error code is S_FALSE, a COM error code that means "it successfully failed". Which is why it says The operation was successful. Misinterpreted for the diagnostic message as "Function failed", that's the description for Windows error 1 and returned by the FormatMessage() winapi function.

The successful failure is entirely expected, you didn't run Ngen.exe on your console mode app yet so the native image for it is not available. Keep looking, this is not it. Change the Log Category back to "Default", native images are not your problem.

answered on Stack Overflow Jan 31, 2015 by Hans Passant
0

This error can also occur if you have a 64 bit dependency while your process or IIS runs on 32 bit.

answered on Stack Overflow Mar 21, 2021 by BornToCode

User contributions licensed under CC BY-SA 3.0