ESRIRegAsm "Blocked" File Error Message

Idea created by on Sep 10, 2012
    • Captain
    • vce501
    • khannaford38
    • heath623
    A customer of mine recently downloaded an updated version of our custom toolbar from our website. The customer operating system is Windows 7.  The customer used ESRIRegAsm to unregister the old DLL and then tried to register the new DLL.  The registration failed with the following error:

    Registration failed
    Could not load assembly 'file:///c:\test\customtoolbar.dll' or one of its assemblies.
    Operation is not supported. (Exception from HRESULT: 0x80131515)

    It took a week to figure out why the new DLL would not register.  
    Windows7 has a new security feature that "BLOCKS" some files when they are downloaded from the Internet.
    In this case it was a ZIP file.  Using the 'right-click' context menu to view the file properties you will see...

    Security: This file came from another computer and might be blocked to help protect this computer.  And, an 'Unblock' button.  Clicking this button allowed the CustomToolbar to register properly.

    So, my idea/suggestion is to have ESRIREgAsm check the properties of the file that is attempting to be registered to see if it is "BLOCKED", and, if it is, provide a more meaningful error message.  Something like...

    Assembly 'file:///c:\test\customtoolbar.dll' is being Blocked by Windows Security.  Please check the file properties and try again after the file has been Unblocked.