locked
Wrong DLL path when MSBuild the OrderedTest RRS feed

  • Question

  • Dear all,

    I develop WinForm application and Coded UI Test in VS2010 Premium Edition (with SP1 and HF of SP1)

    and I have an orderedtest file to include the test methods that I want to run in a solution

    And I try to use the following build

    MSBuild %sourceFolder%MyProject\TestProjects\TestProjects.sln /property:Configuration=Debug;OutputPath=%outputFolder% /t:clean,build /l:FileLogger,Microsoft.Build.Engine;logfile=%buildLogFolder%TEST_PROJECT.log;encoding=utf-8

    command to build the Test Project and OrderedTest, but I find that the OrderedTest file still find the DLL Test Project of Test Methods based on the sourceFolder structure.

    And for above command all Test Project DLL would be put in outputFolder (without structure...).

    I open the Ordered Test File in outputFolder but still find that the OrderedTest find the Test Project DLL by sourceFile structure... Hence other then directly edit  the .orderedtest file in outputFolder, how can I set this so that it follow the structure of outputFolder?

    Best Regards

    Thursday, July 11, 2013 6:50 AM

Answers

  • Hello,

    Thank you for your post.

    Just to make the issue clealy:

    1. What is the ‘outputFolder’ you specify in MSBuild command? Is it bin\Debug folder?
    2. I am not very sure about this statement: the OrderedTest find the Test Project DLL by sourceFile structure. How does the OrderedTest search the Test Project DLL? What is ‘sourceFile structure’?
    3. You want the ordered test to follow the structure of outputFolder. If so, would you clarify it in details with a sample so that we can further look at this issue?

    As far as I know, after you build the solution, the Test Project DLL will be put in the TestProject\Bin\Debug folder. We can’t open the ordered test from the bin\Debug folder since the ordered test contains tests. A test can be opened only within a test project.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Amanda Zhu Thursday, July 18, 2013 1:43 AM
    Friday, July 12, 2013 6:57 AM
  • Hello,

    Glad to receive your reply.

    I have tried to copy the test project DLLs and test files from bin\Debug folder into another ‘output’ folder on desktop and then use MSTest.exe to run test of a DLL. But it complains that the DLL in the ‘output’ folder is not recognized.

    As far as I know, VS can run tests in several places:

    • In the build output folder, typically <your project>\bin\Debug.
    • In a local test deployment folder on the same machine as the build, typically TestResults\XXX\Out.
    • On a remote computer. Remote deployment is used to test distributed or web applications, and applications that must be run on a particular platform.

    I am not sure why you build the test project into a custom output folder using MSBuild. In my opinion, we can’t run test from that custom output folder. I suggest that you try to call test project/test file from bin\Debug to run test with MSTest.exe like this: http://msdn.microsoft.com/en-us/library/ms182487(v=vs.100).aspx

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Amanda Zhu Wednesday, July 24, 2013 9:48 AM
    Friday, July 19, 2013 7:41 AM

All replies

  • Hello,

    Thank you for your post.

    Just to make the issue clealy:

    1. What is the ‘outputFolder’ you specify in MSBuild command? Is it bin\Debug folder?
    2. I am not very sure about this statement: the OrderedTest find the Test Project DLL by sourceFile structure. How does the OrderedTest search the Test Project DLL? What is ‘sourceFile structure’?
    3. You want the ordered test to follow the structure of outputFolder. If so, would you clarify it in details with a sample so that we can further look at this issue?

    As far as I know, after you build the solution, the Test Project DLL will be put in the TestProject\Bin\Debug folder. We can’t open the ordered test from the bin\Debug folder since the ordered test contains tests. A test can be opened only within a test project.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Amanda Zhu Thursday, July 18, 2013 1:43 AM
    Friday, July 12, 2013 6:57 AM
  • Hello,

    What about your issue now? Could you get useful information from our reply?

    I mark my reply as answer. If my suggestion can’t help you, you can come back and unmark it as answer. And then if possible you could let us know the result of the suggestion.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, July 18, 2013 1:43 AM
  • Dear Amanda,

    As I try to put OutputPath when call MSBuild

    And I find that all dll (have 1 dll for each vproj in a large solution) in the dll as well as OrderedTest files and there is no folder structure inside the output folder, but a bit strange that the Ordered Test still keep referring the folder structure as in the vproj and ref to bin/Debug as well... and when I call the ordered test file in output folder, it complaint that the refered dll not work...

    Hence is there any command or option that I'm missing when build the ordered test file in the solution?

    Best Regards

    Tung

    Thursday, July 18, 2013 11:48 AM
  • Hello,

    Glad to receive your reply.

    If you mean that it complaint the referred dll does not work when you call the ordered test file in your custom output folder to run, which tool do you run the ordered test? MSTest.exe?

    Or you get the complaint just when you open the ordered test file from your output folder instead of running test?

    I open the Ordered Test File in outputFolder but still find that the OrderedTest find the Test Project DLL by sourceFile structure...’’ and when I call the ordered test file in output folder, it complaint that the refered dll not work...

    I think your output folder is like the bin\Debug folder.  As I mentioned above, A test can be opened only within a test project. Please post the detailed error messages when you open the ordered test file from output folder so that we can further look at this issue.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 19, 2013 2:37 AM
  • Dear Amanda,

    thx your reply!

    I use MSTest to run the ordered test file in outputfolder

    also, all dll and exe as well as ordered test file is flaten inside the same layer of the output folder and there is no bin\Debug structure there...

    Best Regards

    Friday, July 19, 2013 4:25 AM
  • Hello,

    Glad to receive your reply.

    I have tried to copy the test project DLLs and test files from bin\Debug folder into another ‘output’ folder on desktop and then use MSTest.exe to run test of a DLL. But it complains that the DLL in the ‘output’ folder is not recognized.

    As far as I know, VS can run tests in several places:

    • In the build output folder, typically <your project>\bin\Debug.
    • In a local test deployment folder on the same machine as the build, typically TestResults\XXX\Out.
    • On a remote computer. Remote deployment is used to test distributed or web applications, and applications that must be run on a particular platform.

    I am not sure why you build the test project into a custom output folder using MSBuild. In my opinion, we can’t run test from that custom output folder. I suggest that you try to call test project/test file from bin\Debug to run test with MSTest.exe like this: http://msdn.microsoft.com/en-us/library/ms182487(v=vs.100).aspx

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Amanda Zhu Wednesday, July 24, 2013 9:48 AM
    Friday, July 19, 2013 7:41 AM