locked
Unit Test (CLR help) WCF RRS feed

  • Question

  • User1849788689 posted

    Hi to All,

    I'm having a problem in my Unit Test. We have two webservice (service A and service B) and I'm currenly working on the service B, this service connects to the service A and when I'm doing unit testing it throws an common language runtime error and I need to mark my unit test to pass.

    PS. It actually work when I consume the service A if I actually run the application

    Thursday, November 14, 2013 2:30 AM

Answers

  • User-488622176 posted

    Please verify the compilation settings. You might get this when runninx x64 code on x86 machines. Make your compiled code platform neutral, clean everything and recompile. Pleasee let us know if this had any affect. The error means an invalid or corrupt compiled assembly...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 14, 2013 3:30 AM

All replies

  • User-484054684 posted

    Try by putting try with empty catch block.

    try
    {  
     //YourCode here
    }
    catch(TheSpecificExceptionType ex)
    {
     // No code blocks. Just to suppress the error.
    }
    

    Thursday, November 14, 2013 2:40 AM
  • User1849788689 posted

    The error is common language runtime detected an invalid program

    Thursday, November 14, 2013 3:01 AM
  • User-488622176 posted

    Please verify the compilation settings. You might get this when runninx x64 code on x86 machines. Make your compiled code platform neutral, clean everything and recompile. Pleasee let us know if this had any affect. The error means an invalid or corrupt compiled assembly...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 14, 2013 3:30 AM