Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

.net

fusion

wmi

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.

like image 440
Mark Richman Avatar asked Jan 31 '15 14:01

Mark Richman


1 Answers

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.

like image 84
Hans Passant Avatar answered Oct 05 '22 05:10

Hans Passant