none
Assembly binding fails but only for some users RRS feed

  • Question

  • Hi,

    I've encountered an interesting issue where an product deployed on our user pcs for a number of months has stopped working for some users. The product 'product.exe' includes a reference to 'productservices.dll' version 1.2.0.26020 but a binding log reveals that something is trying to load version 1.2.0.22655. I have tried to identify the problem with Depends.NET without any luck. There are also no 'productservices.dll' in the GAC so only the (correct) version in the application directory should be loaded.

    The most interesting part is that the assembly binding works when running the product as another user on the same machine! I would have thought that assembly binding would work the same way on any given machine regardless of who was logged in. What am I missing???

    Fuslog follows.

    Regards,

    Clint


    === Pre-bind state information ===
    LOG: User = domman\user
    LOG: DisplayName = ProductServices, Version=1.2.0.22655, Culture=neutral, PublicKeyToken=4ca4abe54ebeffbc
     (Fully-specified)
    LOG: Appbase = file:///C:/Program Files/Product/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = NULL
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Program Files\Product\Product.exe.Config
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: ProductServices, Version=1.2.0.22655, Culture=neutral, PublicKeyToken=4ca4abe54ebeffbc
    LOG: GAC Lookup was unsuccessful.
    LOG: Attempting download of new URL file:///C:/Program Files/Product/ProductServices.DLL.
    LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\Product\ProductServices.dll
    LOG: Entering run-from-source setup phase.
    LOG: Assembly Name is: ProductServices, Version=1.2.0.26062, Culture=neutral, PublicKeyToken=4ca4abe54ebeffbc
    WRN: Comparing the assembly name resulted in the mismatch: Revision Number
    ERR: The assembly reference did not match the assembly definition found.
    ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

     

     

    Friday, June 24, 2011 3:58 AM

Answers

  •  

    Hi,

     

    According to your description, the issue is a little strange. As far as I know, loading assembly is not depended on user account. It exists in PE header file of the assembly.

     

    I doubt that you are running different "product.exe" in two user account. One of the "product.exe" loads V1.2.0.22655 and another one loads v1.2.0.26062. I think you can do the trouble shooting steps below to work around this issue:

    1. Re-add the correct version dll to the project.

         Remove the dll from the project, re-add the correct dll to the project. Modify the Copy Local property to true. So the added dll will be copied to local path.

    2. Then update the version of "product.exe" and generate the new version "product.exe".

    3. Run the new assembly on target machine.

     

    I hope this can help you.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Paul Zhou Friday, July 1, 2011 5:58 AM
    • Marked as answer by Paul Zhou Tuesday, July 12, 2011 3:08 AM
    Monday, June 27, 2011 6:49 AM

All replies

  •  

    Hi,

     

    According to your description, the issue is a little strange. As far as I know, loading assembly is not depended on user account. It exists in PE header file of the assembly.

     

    I doubt that you are running different "product.exe" in two user account. One of the "product.exe" loads V1.2.0.22655 and another one loads v1.2.0.26062. I think you can do the trouble shooting steps below to work around this issue:

    1. Re-add the correct version dll to the project.

         Remove the dll from the project, re-add the correct dll to the project. Modify the Copy Local property to true. So the added dll will be copied to local path.

    2. Then update the version of "product.exe" and generate the new version "product.exe".

    3. Run the new assembly on target machine.

     

    I hope this can help you.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Paul Zhou Friday, July 1, 2011 5:58 AM
    • Marked as answer by Paul Zhou Tuesday, July 12, 2011 3:08 AM
    Monday, June 27, 2011 6:49 AM
  •  

    Hi,

     

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

     

    If you have got answers, please remember to mark answer and close this thread.

    If not, any more concerns, please feel free to let us know.

     

    Have a nice day!

     

    Best regards,


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 4, 2011 8:06 AM