Debugging WCF services : Multiple Startup project - c#

My solution constists of -
WCF service hosted on Visual Studio Development server. (Port 8001)
Web Application consuming services. (Port 8002)
I use start multiple projects in debug mode in visual studio solution.
Starting with WebApp debugging, I set few break points in WCF service code.
Issue:
WCF services breakpoint is not being hit. Although the code executes fine & returns the response to UI (WebApp)
These work fine when starting WebApp & Wcf services using two different solution.
Any suggestions ?

Related

WPF Desktop and web service in same solution

I am revising .NET and web services and attempting to test calling the web service I created with a WPF desktop application. The web service builds and runs fine and when I start without debugging in VS Community 2017 it works as expected and I can see the web service end points in the browser along with the WSDL. But when I attempt to add a WPF desktop application and start without debugging to the browser does NOT have the .asmx file in the URL anymore and states -
HTTP Error 403.14 Forbidden
the web server is configured to not list the contents of this directory
I have googled this error and tried several of the suggested fixes but none of them have resolved the issue. Can this be done at all or do I have to publish the web service to IIS Express on its own and have the WPF desktop application on its own? Its just that it would be very useful to have a desktop application within the same solution to code and test

Visual Studio 2013 - project shows up as “Miscellaneous Files” when debugging

I have a project set up of web api and wcf service. I need to debug wcf service by sending request through web api. When i debug, wcf service class is showing in webapi project and project shows as 'Miscellaneous files'. Due to that am not able to debug the service.

VS 2015 unit testing with web api 5

I have a web api MVC5 REST service running in IIS Express under VS 2015.
I want to write unit tests to excercise the REST services.
I want to be testing the REST services syntax and output, not the controller.
My problem is gettin the IIS Express service to be started on a known port when the test starts. How can I configure/code this to make sure that IIS Express is started. (I also noticed a "web" profile in the Web API project's debug section. It seems to start the service as a console. But I can't figure out how to make use of that.)

How to debug calls to ASP.NET web api in Visual Studio [duplicate]

I built a Web API service that's hosted locally on my machine in IIS. I have an iOS app that I'm running via XCode that makes the call to the web service. The connectivity is there, and works. The iOS app successfully makes the connection to my published web service.
The problem is my web service is returning a non descriptive error to the client (iOS), so what I need to be able to do is step through the web service code while running my iOS app.
So, in summary:
I run an iOS app via my MacBook, and it connects to my .NET Web API service.
My Web API service is published to my local IIS, and is returning an error back to the client.
Breakpoints aren't being hit in Visual Studio - do I need to attach my Visual Studio debugger to a specific process? I've tried running my web service in debug mode while running my iOS app, to no avail.
How can I step through my web service code when running the client app (iOS) that accesses the web service?
Attach to process - http://msdn.microsoft.com/en-us/library/vstudio/3s68z0b3.aspx
Make sure "Show processes from all users" is checked, and pick w3wp.exe
You may need to hit the service once first to make sure its started.
To debug an app that's hosted by IIS, you want to attach to process (in Visual Studio it's Tools->Attach to Process or Ctrl+Alt+P) and pick w3wp.exe from the list (you might have to check a few boxes for the process to show up).
Another option is to use our free VS Extension called Conveyor
https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti
With it you open up IIS Express to remote connections on your network (or even the web through tunnelling).
Once you've done that you can debug the project directly from VS and connect to the Conveyor port number (or domain name via tunnelling) and debug as you would locally.
you can use Postman client.
First : run the API FROM visual studio
Second : go to postman put the url and add the parameter in body
More information : http://www.tutorialsteacher.com/webapi/test-web-api
this often works for me i generally list all of the processes in IIS with appcmd command
appcmd list wp
and pretty much you know which process to attach by seeing the names of the web services
if appcmd is not available please visit
Here for configuring this

Use WCF class library in application

I am new to WCF and I don't really understand the puropose of a WCF class library. (it does not look like a library to me it launches a program when I run my application) I have created a WPF application with a reference to my WCF service library. Everything works great under development. When I launch my application from visual studio the service get's hosted automatically by visual studio.
Now let's say I am ready to deploy. If I launch the application from outside visual studio then the service will not run. How do I start the service?
WCF service class cannot exist in a void. You need to host and there are a couple of option for Hosting.
In Visual Studio, there was two main template for WCF, WCF Service Application and WCF Service Library. Depend on your need, choose which template will be good for your project. If you want Self Hosting, better choose WCF Service Library template. (You need to write Hosting Service/Application). If you want to Host in IIS, better choose WCF Service Application.
And check this Tutorial for self hosting.
http://wcftutorial.net/WCF-Self-Hosting.aspx

Categories

Resources