locked
How to debug unit test and start dependent Web Site Application RRS feed

  • Question

  • I've written a WCF service which is hosted in a web application project in my soution (hosted by the dev web server, not IIS).

    I've also added a unit test project to this solution.  The unit test tests creates a client of the WCF Service and attempts to excerise one of the service operations.

    When I debug this unit test, the test fails because the web site hosting the service hasn't been started (despite me setting the Always Start When Debugging property of the web site application to true.)  How can I tell Visual Studio to start my web site application before running my unit test?

     

    Wednesday, April 21, 2010 1:42 PM

All replies

  • A friend of mine pointed me to the  AspNetDevelopmentServerAttribute This launches the web site, but does so using a dynamic port and no virtual directory (basically ignoring the configuration set up in the hosting project).  This is a problem.  My service is defended by a WIF STS, and changing the address of the service, changes the realm of the relying party, invaliding my relying party configuration in the STS.

     

    I need to be able to run this web site as its configured in the project.

     

    Thoughts?

    Wednesday, April 21, 2010 2:21 PM