How to stop WCF Service project from being hosted automatically while debugging - asp.net

I have Asp.Net solution that contains few WCF Service projects. Every time i run the application in debug mode, i can see that my services being hosted on ASP.Net Development Server. I just have single project in the start up.
Is there a way i can avoid this without removing these WCF Service projects from the solution?
To reproduce the situation. Create one ASP.Net project and add several WCF Service projects. Press F5 and you will see the WCF service projects being hosted on local development server.
This is what i have tried so far:
1) Project->Properties->Don't open a page. Wait for a request from an external application. I selected this option but it still hosts the service.
2) Unchecked ASP.NET in Debuggers selection. It still hosts the service.

Try right click the WCF project and go to the WCF Options tab.
Uncheck the Start WCF Service Host when debugging another project in same solution.

Is this what you are looking for:

Related

How to host a webApp with a Web Service

I have an ASP.NET web application that does some calculations using a Web Service. I have two questions about hosting it locally on my machine through IIS.
First, Do I need to host the two projects, the Web App and the Web service ? I have tried to host the web app but when I tried to run it was not able to connect to the web service.
Second, how would I make this web App accessible to the people within the company network only?
Thank you!
Steps:
1.) Create web service.
2.) Paste your web service bin ==> Debug Content in IIS if already set it up(IIS).
3.) Set Framework in application pool(IIS).
4.) (Click Web Service Site Created(IIS)) == >Set up Browsing Directory to enable.
5.) select .asmx file(right click) ==> Browse.
6.) Web Service is already running.
7.) Get the Link of your Web Service copy and paste into (9 step).
8.) create vb.net/c# project.
9.) Right Click references tab of your vb.net/c# Project ==> Add Service Reference paste web service url in address textbox == > Go.
10.) Create service reference name ==> ok.
11.) you have your web service now at your project.

service discovery during "Add Service Reference"

i'm building an Asp.Net app (contains the service) with Silverlight control (need to use the service) and having a problem after i discover the service and press OK button, can anyone help me please?
Try/Check the following:
Your service project is being properly build with no errors.
There is no other IIS / IIS express servers running in background.
Try to open the service address that you are trying to consume in the browser and see if it is loaded OK.
This should give you a lead on the problem.

Starting .Net web service on the same port as the ASP.Net application

We have a simple Visual Studio solution containing 2 projects:
A.) Simple ASP.Net website
B.) RESTful web service hosted in another ASP.Net application
We want to simply start the projects in Debug mode (F5) and have A consume data from B through Ajax. We do not have the possibility to configure IIS on all development machines (because some of them are on the client's side). The problem might be that JavaScript needs to be in the same domain as the URL it posts to.
Is there any way we can use Visual Studio 2010 Development Server to start both applications simultaneously in debug mode on the same port?
If this is not possible, what is the next best thing you can recommend?
We solved this problem by installing IIS on the development workstation.
In each Visual Studio project, on the Web property page, select Use Local IIS Web server.
Do not check Use IIS Express. The Project URLs will be set to http:localhost/<projectname> (note: in the same domain). You’ll be prompted to Create a Virtual Directory for each. Each will be assigned to the default IIS app pool. Open the Internet Information Services (IIS) Manager. Click Application Pools on the left pane. On the right pane add another integrated application pool. For one of the applications, open the Advanced Settings... In the properties view select the app pool you just created as the application pool. The applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.
Yo won't be able to host different apps on the same port within a Cassini instance, there are tools that might be useful but I would leave Cassini host them on different ports which is its regular behavior.
Options are (not tested):
UltiDev
Cassini Extesion
By the way, not sure if you know this, but to start both projects go to Set startup projects, there's an option on the Solution context menu.

Switch from consumer application to WCF (servicestack) by debugging in Visual Studio

I am developing one product and there are 4 separate projects, in that I have developed one EXE project and WCF and I have done switching in debugging mode by attaching WCF project in process of debugging client of EXE and it has worked.
But when I transfer my WCF to servicestack then I could not able switch between them.
I am running my EXE project and and attached my WCF(servicestack) project to process
JsonServiceClient client = new JsonServiceClient("MYServiceURL");
RESTWCF.ServiceModel.Perfmon objBalPerformanceDataProperties = MakeObjectForServiceStackToInsertData();
var res = client.Post<RESTWCF.ServiceModel.Perfmon>("/perfmon", objBalPerformanceDataProperties);
When I click F11 on client.post I could not able to switch in WCF project, I think you can make sense of my problem.
Give me some solution of this problem so I can debug my code of WCF project (to find error :) in that)
Thanks.
You can only debug one host project at a time.
If you want to test the server set the ServiceStack project to be Start-up Host and press F5 to start debugging the ServiceStack host. Put a break-point at the start of the service you want to hit.
You can then just Run (i.e. without debugging) the client application which if everything is configured correctly, it should hit your breakpoint.
To make sure you're debugging the service correctly, instead of running the client first try calling the web service via a url, e.g:
http://localhost/MyServiceUrl/perfmon
If it hits the break-point you set, then all is well and you can run the client application as mentioned above.
Also it's a good idea to include ServiceStack's debbuging symbols, i.e. it's *.pdb files in the same folder as it's *.dll's - as it helps with debugging.
Note: WCF has nothing to do with ServiceStack - In a lot of cases that's considered an insult :-)

can I debug my web project and wcf project on same vs 2008 instance?

I have two projects in my solution
1- asp.net web project.
2- wcf serivce project.
3- other common projects between two listed above
Current on the local dev machine I have to run two visual studio instance to run both projects in debug mode. That makes the system run out of resources as these projects share some other project in the soultion which are heavy in files.
Is there a way i can hookup the wcf project on a sinlge visual stodio instance and also be able to debug my asp.net web project. ?
I do not want to combine the web and wcf project in to one. Have already considred this option.
thanks for sharing your thoughts in advance.
You can.
Set your web project to use iis.
Use attach to process menu option to select two processes - w3 and service.
Sources for Both processes that you attach to has be in your solution.
Actually you can attach to more than two, in my project i sometimes debug two wcf services and webapplication and js in IE as well
Add all the projects in the same solution, set the client (the asp.net app) as the startup project, hit run... you'll be able to debug through from the client to the service and back again.

Resources