locked
Unit testing partially signed assemblies in VS2010 RRS feed

  • Question

  • Hi,

    I have a class library project (which is partially signed) which I want to unit test. Occasionally I see the "Strong name verfification failed" error coming in. In my startup and cleanup scripts section under localtestsettings I have defined two cmd files: One to skip the verification of partially signed assemblies (on startup) and then add verification back once the test is complete. Here is the code in these two files:

    Startup: "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sn.exe" -Vr *,2e908aaed607bb28

    Cleanup: "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\sn.exe" -Vu *,2e908aaed607bb28

    When I run the test, all test fails with the same error mentioned above. It looks like these scripts are not getting executed. However when I execute this startup file from VS 2010 command prompt and then execute my test cases from visual studio, everything works well. If I execute test cases again immediately after executing the first ones, I get the same error.

    Why is this happening? Also it happens randomly. I had the same test cases executed fine from Visual Studio a few days back and nothing has changed since then.

    Any help regarding this would be highly appreciated.

    Thanks

    Gaurav Mantri

    Cerebrata Software

    http://www.cerebrata.com

    • Moved by Figo Fei Friday, May 28, 2010 8:33 AM (From:Visual Studio Team System - Testing)
    Thursday, May 20, 2010 7:00 PM

Answers

  • Hello Gaurav,

    we will have to look at the specific installation to debug further why it works on some machine and not on others. One guess I could make is that the Strongname disable is mis-configured on some machine.

     

    Thanks,
    Abhishek

    Friday, November 5, 2010 6:39 AM

All replies

  • Disabling strong name verification should NOT be done in setup/teardown scripts of the test run. The process executing the run needs to be restarted after disabling the strong name and since setup script is executed during the execution of the test run, so its restart is not possible.

    • Proposed as answer by Rishi K Wednesday, June 2, 2010 12:29 PM
    Wednesday, June 2, 2010 12:29 PM
  • Hi Rishi,

    Thanks for providing an answer. We had already disabled the strong name verification for our project assemblies so that we can continue developing our solution and that works perfectly well for debugging and/or running our applications. It's just that when we run the tests using Visual Studio, it does not work. Funny thing is that it works on some computers and on some it doesn't. Also when I execute the test cases using mstest.exe, everything works well.

    Any clues as to why this is happening?

    Thanks

    Gaurav

    Wednesday, June 2, 2010 12:53 PM
  • Hello Gaurav,

    we will have to look at the specific installation to debug further why it works on some machine and not on others. One guess I could make is that the Strongname disable is mis-configured on some machine.

     

    Thanks,
    Abhishek

    Friday, November 5, 2010 6:39 AM