Answered VS11 Beta: MVC 4 Tests do not execute

  • Sunday, March 25, 2012 12:05 AM
     
     

    I've created a new MVC 4 project with Unit tests based on Visual Studio Unit test.

    When I Ctrl+F5 on the test project I get a dialog stating:

    A project with an Output type of Class Library cannot be started directly.

    In the output console it says:

    ------ Discover test started ------

    Cannot start process because a file name has not been provided.
    ========== Discover test finished: 0 found (00:00:00.2570147) ==========

    When I run from the Unit test explorer it says:

    ------ Discover test started ------

    Cannot start process because a file name has not been provided.
    ========== Discover test finished: 0 found (00:00:00.2410138) ==========
    ------ Run test started ------
    The underlying provider failed on Open.
    ========== Run test finished: 0 run (00:00:05.6363224) ==========

    What am I missing here?

All Replies

  • Sunday, March 25, 2012 2:17 AM
     
     

    First right click on the MVC project and click set as start-up project, open test menu and choose run test, see the following images

    Set as StartUp Project

    Run Unit Test


    We are volunteers, if the reply help you mark it as your answer. thanks!!

    Blog: http://mohamedradwan.wordpress.com

     

  • Sunday, March 25, 2012 2:20 AM
     
     

    Hey,

    Ctrl + F5 or F5 doesnt run the tests in current project in Visual Studio 11.

    Can you try running the tests by right clicking and chosing "Run Tests" and or from Unit Test Explorer and let us know how it goes ?

    Thanks

    Bhuva

  • Sunday, March 25, 2012 6:53 AM
     
     

    Hi,

    Both suggestions do not work.

    Running from the Unit Test Explorer (choosing Run all) I get the same messages in the Output console.

    In the Unit Test Explorer pane it says:

    "Click "Run All" to build, discover and run tests in your project. Please ensure an appropriate test framework adapter is installed."

    Although there are TestClasses and TestMethods there is no list of tests to be done.

    Thanks.

    Timo

  • Monday, March 26, 2012 7:00 PM
     
     Answered

    I found the solution.

    Apparently an assembly from VS11 Developer Preview was not uninstalled and caused the problem.

    See http://blogs.msdn.com/b/aseemb/archive/2012/03/02/upgrading-vs-from-developer-preview-build-to-vs-11-beta.aspx for the issue and the solution.

    Thanks for everyone's help.

    Timo

  • Tuesday, April 10, 2012 9:00 PM
     
     

    I'm getting the same thing but it's a clean machine and the above is not applicable.

    Any other reasons why this might be happening? I had to downgrade all of the projects in the solution to .NET 4.0 because of bugs with EF 4.3 and Web API SPA etc. It was working before that.

  • Thursday, April 19, 2012 2:40 PM
     
     

    This answer didn't help me. I'm facing the same problem.

    I posted a question at StackOverflow: http://stackoverflow.com/q/10159828/114029 (there's a screenshot there showing the error I'm getting)

    and filled a bug report at Microsoft connect:

    http://connect.microsoft.com/VisualStudio/feedback/details/736989/vs-11-beta-cannot-start-process-because-a-file-name-has-not-been-provided

    I tried reinstalling VS 11 Ultimate Beta but it didn't change anything.

    Hope someone have a clue about what's going on...

    Thanks,

    Leniel


    Leniel Macaferi http://leniel.net