VS2015:Failed to debug a WCF service hosted in IIS - wcf

I want to debug my WCF service hosted with my WCFClient application in the same dev box. I can run my WCFClient application successfully. My WCF service binary model is Debug. WCFClient application and WCF service are compiled under .Net4.5 framework within windows8 OS. And my WCF service hosts in IIS7 in the same box as well.
The error is :
Unable to automatically step into the server. Unable to determine a stopping location. Verify symbols are loaded. Error while processing breakpoint.

Hi Anyone who enters here. I resolved the issue with a console application by invoking my WCF service, this is a bit tricky.
I run my WCF application in asp.net web form. So there will be issue after attaching w3wp.exe process. Then I tried to use a console application to test
my WCF service, I can debug into the code.
Thanks anyway. I am new to the stackoverflow. Who can help me to know how to close my question?
Thanks,
Ethan

Most of the time, when you type an error message in Google, you find your answer... It's typically faster than asking a duplicate question on SO.
It's also a good idea to write the error message in plain text instead (or in addition to) a screenshot. This way, a person having the same problem will easilly find your question and eventually an answer.
Take a look at this forum post and this one.

Related

how can I test a WCF service using XAMPP to work with Apache server?

I built a WCF service on a windows virtual machine, and tested it with the WCF test client by typing this on my browser:
http://localhost/Service1.svc/getAllCustomers
... and it works pretty good. Now the problem is that I want to do the same test in my real computer (not the VM).
I'm using XAMPP on the VM, I have set the project on the htdocs folder, and I type this on my browser:
http://10.211.55.3/WCFWebService/Service1.svc.cs/getAllCustomers
The problem is that it doesn't return the result of calling getAllCustomers, instead it returns the Service1.svc.cs in plain text.
I want it to do the same thing it does on the VM - can someone tell me what the problem is? I think it's because on the VM it works with the WCF test client, and since my computer is a Mac I can't run the WCF test client.
A WCF service can't run on an Apache web server instead you should install IIS Server on the VM in order to test the service.
Refer to this: http://msdn.microsoft.com/en-us/library/ms733766.aspx
I found this with a Google query.
I kept the tab open, but continued exploring the other search results.
One I found particularly interesting was this one: WCF acting as Web Service without IIS
It appears WCF gives options other than IIS to host the web service (Console Application, Windows Application, Windows Services).
The Windows Service link is provided here: How to: Host a WCF Service in a Managed Windows Service
I have not done this, so I cannot elaborate on what problems you will run into.
I just want others that may run into this (like I did) to know that the one answer posted last year may not actually be the end of the road.

Adding a service reference to a WCF service that is using Net.TCP

I am new to creating WCF services. I have created a WCF service that is using TCP. The service is running on IIS 7. From within the solution file I have a client project that I have used to test my service. I've run the client project using a TCP endpoint and it accesses the service and everything is fine.
Now, I want to access my TCP service from a new standalone project, one that is not part of the service's solution like the client project. I created a new project in VS 2008. I clicked on Add Service Reference, entered the net.tcp address (net.tcp//.......) and clicked go. An error is returned saying that the "Metadata contains a reference that cannot be resolved."
Is there something further in IIS 7 that needs to be configured? Am I correctly adding a reference to a service that is using TCP? If needed I can supply more information but at this point I am not too sure what I need to post. As I said the service works perfectly from the client project but I can't even access the service from a standalone project.
Thanks in advance for your help.
Look at your Web.config file. Do you have an entry that starts out like
<endpoint address="mex"...
and then specifies a contract="IMetadataExhange? If not then you need to add a meta data exchange endpoint.
If you have $29 to spare, you can save yourself a LOT of time and watch some great videos by Aaron Skonnard on WCF (in the beginner examples there is an 8 minute video on hosting WCF in IIS), The $29 gets you a one month subscription so you can watch anything in the library. Money very well spent in my opinion. [Edit] I forgot to mention you can get a free trial, I think it's good for a month or 4 hours of viewing whichever comes first.

Need guidance in calling WCF service from Silverlight 4

Okay guys, I call upon your combined intellects. I have a web application with a silverlight app that calls a ria service. The ria service is defined inside the web application and everything else is just dandy.
The issue is this.
It is my understanding that in order for the silverlight application to talk and know what the ria service is, you need to add a service reference for that service. The service reference defines the ria service and sets up the connection binding. One of the files it adds is the ServiceReference.ClientConfig which has the connection binding in it. During the course of this application's development, this is the way it was set up. And it worked perfectly fine locally and on the dev server.
Unfortunately there were issues when deploying to the clients in-house server. At this point I was onto other projects while my co-worker continued with the deployment. He soon became frustrated with the goofy errors that were occurring and recruited some help. This dev came in and, albeit got it working, but in order to do so he removed the service reference from the silverlight project but left the ServiceReference.ClientConfig which pointed to the location of the service in the web application(but that's it, no definition or explanation as to what the service does and I'm not sure how the silverlight app is supposed to know how to work with it..). This works perfect on my co-workers workstation and he has deployed this version to the clients server fine.
When I open the project it doesn't run at all. And the reason why is that it doesn't know what the service is that i'm using in code. Specifically, it doesn't know where this is (names changed for clarification):
Imports SilverlightApp.ServiceReference.WebApp.Service
I have cleaned the solution, completely deleted and got the latest from source control, built the web app first and made sure the asp.net dev server was running so that the address in the ServiceReference.ClientConfig resolved correctly. But, alas, it still doesn't know what Imports SilverlightApp.ServiceReference.WebApp.Service is.
So, to get it working on my workstation, I added the ServiceReference back but kept the current connection bindings so that it matched the endpoint in the web app web config. and changed the import statement to Imports SilverlightApp.ServiceReference and everything works fine.
What is the reason for this insanity?!?!
All the things you are talking about relate to a WCF service NOT a WCF RIA Service. They work in quite different ways when consuming them in your client app.
A WCF service will require a service reference and the ServiceReference.ClientConfig.
A WCF RIA Service does not. The link to the WCF RIA service is set in the silverlight project properties in the Silverlight tab at the bottom. When you build it will generate client side context code in the Generated_Code folder. Show all files and you will see it.
Hope that helps?
Kevin

Delphi7 client connecting to WCF service

I have a WCF service and 2 clients I'm testing with. The first client is written in c# .NET 3.5 and has no trouble connecting to the WCF service. The other client is written in Delphi7, and it's the one I'm interested in getting working. This is the interesting part. If I start the service then hit it with the Delphi client, it won't connect... but if I start the service then hit it with the .Net client then try the Delphi client, it works ! Could be something to do with the design-time addresses, I'm not sure. Maybe a more experienced person will know what's going on and what I need to do to get my Delphi client working without needing a .Net client running alongside it. It might be relevant to note that the service is currently being hosted in a winforms app.
regenerating the wsdl and re-importing it into Delphi 7 seems to fix it.

How can I use net.tcp without IIS?

I have a web site and build a wcf service in it. I can run the code by calling it from a test page in the web site. The web site is ran by the vs2010 development server.
I do have IIS 7 but never use it.
Now I want to use the NetTcpBinding instead of BasicHttpBinding, everyone says it should be enabled in IIS, but how can this be done without using IIS and keeping everything in 1 project?
Thanks for any help
edit: A Windows service would be a solution, but that would mean adding a project to the solution, I really want to keep everything in 1 website, took me quite some time to get the service in the website in the first place.
This is about my own test version of the website, the production server is out of my reach. The service must be expanded by other developers later on it's bad if they have to run IIS just to test the service.
One way is to host the WCF service in a Windows Service - see How to: Host WCF in a Windows Service Using TCP for sample code.
Are you talking about how to develop without using IIS7 or how to put the service into a production environment without IIS7?
If it's the latter, then Stuart's answer is correct, but otherwise I would suggest that you start to develop using the web server that you will eventually be hosting the web site/service on.
Hosting in IIS7 has several advantages over hosting in a Windows Service such as fault tolerance and process isolation already built in.
Thanks for the replies guys, it looks like I have 3 options:
1. Host the service in a seperate project.
2. Host the website in IIS.
3. Use HTTPS, also secure.
PS: My development environment is very different from production :(
In development I have unit testing and in production there are old ASP pages, that I can't even acces, but sometimes must refer to...