WCF Service Not Starting When Client Project Run - visual-studio

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

Related

How to publish MVC3 razor with WCF service on IIS 7.5

I have created a service-oriented MVC3 application in Visual Studio 2010. I have used layered architecture for my application. It has a separate project for WCF Services,and separate projects for BLL and DAL, and also one for Entities. Now I want to publish my MVC application on IIS 7.5. I have Windows 7 Home Premium, and I use SQL Server 2008 R2 for my database. How can I publish it in IIS 7.5?
Note: I have created library projects for Entities, BLL, and DAL and use MVC3 for web project and WCF Service Application for WCF services.
I already tried to publish it by using this tutorial, but when I run the application in a browser, it does not load my Javascript, jquery and CSS files, and it give Network error 404 file not found.
Use, #Url.Content("~/blah/blah") to convert the relative path to an application absolute path.

Silverlight OOB App and Web Service in same Solution

I'm using vs2012 and have created a Silverlight 5 out of browser application that talks to a MVC 4 webapi web service for its data.
With both projects in the same solution I can successfully fire up and test the silverlight application with the web service if I have the web service set as the startup project and have the application running in the browser and embedded in a view on the MVC web service site. If I set the silverlight application as the startup application so that I can run it out of the browser like the user will, then the MVC site doesn't get started and the web service isn't available to connect to.
Is there anyway to have both projects running in the same instance of visual studio, but have the silverlight app run out of browser?
Try this:
Right click on solution from Solutin Explorer and select Properties. Then select the Multiple startup project option inside Common Properties/Startup Project and set both as 'Start'. Close and Start Debug again.

Is it possible to add a console application in a WCF service solution?

I am currently creating a WCF service application using Visual studio 2010.
Is it possible to add a console application as a new project in the same WCF service solution?
Yes it is. Just add a Console application project to your solution.

Start ASP.NET Development Server automatically in unit tests

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.

VS2010 - Debugging a silverlight 4 OOB with breakpoints in the WCF services

I created a silverlight 4 app , and chose to host it in a ASP.NET Web Application.
I added a Silverlight-enabled WCF Service to the Web Application Project.
The Web Application project is now set to be the startup project.
This way every thing works fine and I can stop at breakpoints in the WCF services in the Web app project, and also stop at breakpoints in the silvelight project.
In the silverlight project properties, I changed it to be an OOB. This causes the startup project to automatically jump to the silverlight project. OK, so now when I debug the silverlight app it's opened OOB, but now I cant put breakpoints in the WCF services in the Web app project (Although the silverlight client can communicate with the web app project) . So I changed the startup project to the Web app again. But now the silverlight app doesn't start as OOB.
How can i debug in the WCF services, and run it OOB at the same time ?
(My app is designed as an OOB, so it's important for me to develop it that way).
First, You have to set a breakpoint on your client side, right before you call a service operation.
Second, set another breakpoint inside the service method on the server side.
Now, when you start debugging and hit the first breakpoint, attach the dev server process to the debugger by doing the following steps:
click Debug - > Attach to process
select the Webdev process and click attach.
now when you continue to debug, you will be able to debug your service as well :)
When you start debugging, you should go into Visual Studio and manually attach the debugger to the development web server (Debug->Attach to Process...). This step is not done automatically when debugging OOB.

Resources