locked
OrderedTest in visual studio 2013 RRS feed

  • Question

  • Hi All,

    Please help as i'm new to visual studio 2013. I can run any unit test individually but when i try to run ordered test it given me following error:

    Result1 Name: 001- SampleTest1 (SampleOrderedtest)
    Result1 Outcome: Failed
    Result1 Duration: 0:00:00
    Result1 Message: Class Initialization method TestWorkflowService.WorkflowServiceCases.ClassInit threw exception. System.Reflection.TargetInvocationException: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Sample.SoapBindings.XmlSerializers' or one of its dependencies. The system cannot find the file specified..
    Result1 StackTrace:
    at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly(Type type, String defaultNamespace, XmlSerializerImplementation& contract)
       at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
       at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
       at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
       at com.quark.qpp.core.security.service.remote.SessionService..ctor()
     --- End of inner exception stack trace ---
        at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)

    Is there any configuration level change that i'm missing. Thanks in advance.

       
    Wednesday, April 15, 2015 10:26 AM

Answers

  • Hi Dinesh,

    Thanks for your reply.

    According to your description, as you pervious siad that you could run any unit test individually. YOU mean that you csn run unit test individually in VS2013, am i right?

    If yes, as you siad that you can run the ordered test fine in this VS2010, but after you upgraded this ordered test from this VS2010 to the VS2013, you could not run this ordered test fine in this VS2013, am I right?

    If yes, as far as I know that Visual Studio 2013/ 2012 includes test project compatibility with Visual Studio 2010 SP1 test projects. For example, test projects that you created with Visual Studio 2010 SP1 can be opened directly using Visual Studio 2013/ 2012 without any upgrade.

    Reference:

    https://msdn.microsoft.com/en-us/library/jj635152.aspx

    So please try to check if you create the unit test in this VS2010 SP1.

    >>The concern is earlier it was working fine and now its creating the above mentioned issue:Could not load file or assembly 'Sample.SoapBindings.XmlSerializers' or one of its dependencies. The system cannot find the file specified..

    I suggest you could try to check if you could try to find this 'Sample.SoapBindings.XmlSerializers' assembly in your folder location.

    In addition, I suggest you could try to right-click the reference under the unit test project->remove this 'Sample.SoapBindings.XmlSerializers'  and then re-add this 'Sample.SoapBindings.XmlSerializers'  assembly check this issue.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    • Edited by Tina-Shi Sunday, April 26, 2015 11:58 AM
    • Marked as answer by Tina-Shi Monday, April 27, 2015 1:40 AM
    Wednesday, April 22, 2015 2:01 AM

All replies

  • Hi dineshigd,

    Thank you for posting in MSDN forum.

    Based on your issue, as you said that since you can run any unit test individually, but when you add these unit test methods to the ordered test, it could not work fine in VS2013.

    So could you please tell me how you add these unit test methods into the ordered test? If possible, I suggest you could share me the detail steps about it.

    From this error message, it said that Class Initialization method exception and Could not load file or assembly.

    I suggest you could share me the mainly code about these unit test methods which you add into the ordered test.

    I suggest you could try to clean your solution and then re-build again, then run your ordered test check this issue again.

    Please refer the following MSDN document to add the test method into the ordered test again check this issue.

    https://msdn.microsoft.com/en-us/library/ms182631.aspx

    Since we could not reproduce your issue in my side, so if possible, I suggest you share me your unit test project include the ordered test and then upload the OneDrive and copy link here.

    Thanks for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 16, 2015 9:57 AM
  • Hi Tina-Shi,

    Thanks for your reply. 

    Actually I created my project in VS 2010 where everything was working fine and then we upgraded to VS 2013 because we consumed libraries that are built in .Net Framework 4.5.1. 

    I've added the test cases into ordered test case the same way as mentioned in link suggested by you.

    The concern is earlier it was working fine and now its creating the above mentioned issue. 

    Moreover I've one more question, Can you please tell me in which scenario, VS skips executing test cases while executing ordered test cases. The same use to executed successfully in VS 2010.

    Thanks

    Dinesh

    Tuesday, April 21, 2015 6:59 AM
  • Hi Dinesh,

    Thanks for your reply.

    According to your description, as you pervious siad that you could run any unit test individually. YOU mean that you csn run unit test individually in VS2013, am i right?

    If yes, as you siad that you can run the ordered test fine in this VS2010, but after you upgraded this ordered test from this VS2010 to the VS2013, you could not run this ordered test fine in this VS2013, am I right?

    If yes, as far as I know that Visual Studio 2013/ 2012 includes test project compatibility with Visual Studio 2010 SP1 test projects. For example, test projects that you created with Visual Studio 2010 SP1 can be opened directly using Visual Studio 2013/ 2012 without any upgrade.

    Reference:

    https://msdn.microsoft.com/en-us/library/jj635152.aspx

    So please try to check if you create the unit test in this VS2010 SP1.

    >>The concern is earlier it was working fine and now its creating the above mentioned issue:Could not load file or assembly 'Sample.SoapBindings.XmlSerializers' or one of its dependencies. The system cannot find the file specified..

    I suggest you could try to check if you could try to find this 'Sample.SoapBindings.XmlSerializers' assembly in your folder location.

    In addition, I suggest you could try to right-click the reference under the unit test project->remove this 'Sample.SoapBindings.XmlSerializers'  and then re-add this 'Sample.SoapBindings.XmlSerializers'  assembly check this issue.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    • Edited by Tina-Shi Sunday, April 26, 2015 11:58 AM
    • Marked as answer by Tina-Shi Monday, April 27, 2015 1:40 AM
    Wednesday, April 22, 2015 2:01 AM