Start ASP.NET Development Server automatically in unit tests - visual-studio-2010

In Visual Studio, if you begin debbuging on a webservice, the ASP.net Development Server will start up for you.
I have a series of unit tests that rely on this server being here. How can I find out how this Development Server is invoked? I would like to start it up automatically.

Related

Visual Studio Load Test

I have a web application which I want to test with Visual Studio Load Test feature.
I could create a load test on my local machine successfully.
My application deployed to a Windows Server and I would like to test it using TFS.
Can I deploy load test with my web application as well?
I need a stress test so I would like to use load test for hours which is quite difficult using my local machine, but unfortunately I don't find any useful tutorial.
My expectation is that I can deploy my load tests, and I can run that without local machine and Visual Studio.

Run MSTest unit tests on a project when it needs to be running

I am looking to run some automated RestSharp API tests in Continuous integration.
Right now, the application API is running in it's own project, which is set as a Startup Project. The Web App is running in a separate project. And when they are both run manually from Visual Studio, the app's UI can be manually tested against the locally running API (That's just for reference, I only need the API project to run for my tests to work).
So right now, to run my automated API tests as I script them, I start the API project to get the API up and running locally, then open a new window of Visual Studio, and run my MSTests from there.
My question is, how do I get the API project up and running automatically, so the tests can be run against the API? Can I start tests, while the API project is actively running in Visual Studio?
Mainly, how can I run these API tests in Continuous Integration, if the API needs to be started up in a separate VS window every time?
Sorry for the fairly broad question, I am a test automation engineer, and not an API developer. A pointer in the right direction would be great.
You can deploy the Web API to IIS (or IIS Express). In that way, it would be running in the background rather than launched from Visual Studio. The CI tool would then update the deployment after it creates a new build, but before it runs the tests. I would start with the documentation for whatever CI/CD system you are using, but assuming you're using TFS, here is a reasonable starting point: https://www.visualstudio.com/en-us/docs/build/apps/. There are links from that page for deployment and CI.

WCF Service Not Starting When Client Project Run

I am new to WCF in VS 2015 and have a simple query. I have a solution in which I have my basic WCF service and a simple Windows Forms client to test the service. It all compiles OK but if I set the client project as the startup project the WCF service is not started in IIS Express. If I set the WCF project as the startup project and then run the client form Explore it runs Ok and I can debug etc.
My question is how to start the WCF Service automatically when I run the client project in Visual Studio
Thanks
Steve

LocalDb for Unit Testing with Entity Framework 5.0 deployed to AppHarbor

Is it possible to run unit tests in Visual Studio 2012 against a localDb that is built with Entity Framework 5.0 Code-First? Currently our development is against a SQL Express Server Instance but this will not work with AppHarbor deployments since the Db is unavailable.
I'm not sure that using LocalDB would solve your problem. To use LocalDB, LocalDB still has to be installed on the machine running your unit tests and that may not be the case on AppHarbor.
Consider these resources for alternatives:
Integration Testing Entity Framework code first with in-memory database (use SQL Server CE using a file in unit test directory)
Effort (let's you create schema and run unit tests in memory without touching the file system - probably preferable)

Visual Studio 2010 published web site returns "Could not load assembly App_Web_xxxxxx.dll"

I am working on client's application in which we have two servers - development server and testing server. We first develop applications on development server and then publish it and host it on test server for client testing.
Testing server has Microsoft .NET framework 3.5 SP1. On development we have Visual Studio 2010.
We publish the website on development server using VS 2010 and then copy that folder to testing server and host it on its IIS.
Whenever we try access any aspx page of site hosted on testing server, we get error:
Could not load assembly App_Web_xxxxxx.dll". Make sure it is compiled before accessing the page
What can I do to resolve this?
This could be due to a lot of reasons.
I would start by trying one of the following things..
Make sure your IIS Site has the correct .net version specified - same as your application
Make sure you have all the required .net components installed in windows features (control panetl)
Look at event viewer for more errors and post it here
OK guys here is the solution.
Since my testing server is having Microsoft .NET framework 3.5 so on the development server while publishing from VS 2010, I have to choose target framework as 3.5.
Do this:
Right click web site -> Property Page -> Build -> Change the target framework.
After doing this setting, publish the web site again.

Resources