How can I enable Assembly binding logging?

前端 未结 9 1545
长发绾君心
长发绾君心 2020-12-07 14:03

I\'m getting, \"Could not load file or assembly \'Bla\' or one of its dependencies. An attempt was made to load a program with an incorrect format.\"

A portion of th

相关标签:
9条回答
  • 2020-12-07 14:21

    For me the 'Bla' file was System.Net.http dll which was missing from my BIN folder. I just added it and it worked fine. Didn't change any registry key or anything of that sort.

    0 讨论(0)
  • 2020-12-07 14:22

    Just create a new DWORD(32) under the Fusion key. Name the DWORD to EnableLog, and set it to value 1. Then restart IIS, refresh the page giving errors, and the assembly bind logs will show in the error message.

    0 讨论(0)
  • 2020-12-07 14:30

    Instead of Creating New Application Pool,You can go to your Existing application Pool->Right click Advance setting->Enable 32-bit Application-----Set to TRUE

    0 讨论(0)
  • 2020-12-07 14:31

    This error comes for me in windows application while calling server dll from client. After system restart it works fine

    0 讨论(0)
  • 2020-12-07 14:32

    If you sometimes run different versions of your application, make sure you delete 'Bla' from the application bin directory if the version running doesn't need it.

    0 讨论(0)
  • 2020-12-07 14:37

    A good place to start your investigation into any failed binding is to use the "fuslogvw.exe" utility. This may give you the information you need related to the binding failure so that you don't have to go messing around with any registry values to turn binding logging on.

    Fuslogvw MSDN page

    The utility should be in your Microsoft SDKs folder, which would be something like this, depending on your operating system: "C:\Program Files (x86)\Microsoft SDKs\Windows\v{SDK version}A\Bin\FUSLOGVW.exe"

    1. Run this utility as Administrator, from Developer Command Prompt (as Admin) type FUSLOGVW a new screen appears

    2. Go to Settings to and select Enable all binds to disk also select Enable custom log path and select the path of the folder of your choice to store the binding log.

    3. Restart IIS.

    4. From the FUSLOGVW window click Delete all to clear the list of any previous bind failures

    5. Reproduce the binding failure in your application

    6. In the utility, click Refresh. You should then see the bind failure logged in the list.

    7. You can view information about the bind failure by selecting it in the list and clicking View Log

    The first thing I look for is the path in which the application is looking for the assembly. You should also make sure the version number of the assembly in question is what you expect.

    0 讨论(0)
提交回复
热议问题