Reputation: 421
The goal here is to be able to step into the WCF service code, as well as the Silverlight app code.
Add service ref to new service in SL proj
In Model\DataService.cs replace GetData with the code below
public void GetData(Action<DataItem, Exception> callback)
{
// Use this to connect to the actual data service
//var item = new DataItem("Welcome to MVVM Light");
var client = new ServiceReference1.Service1Client();
client.GetDataCompleted += (s, e) =>
{
var userCallback = e.UserState as Action;
var item = new DataItem(e.Result);
userCallback(item, null);
};
client.GetDataAsync(123, callback);
}
Place a breakpoint in the GetData method of Service1.svc.cs
F5 to start debugging.
You’ll get a dialog saying you can’t debug.
“The Silverlight project you are about to debug uses web services. Calls to the web service will fail unless the Silverlight project is hosted in and launched from the same web project that contains the web services.”
What do I need to change to allow me to debug the WCF service?
Upvotes: 1
Views: 1293
Reputation: 3301
It sounds like your Silverlight application and WCF Service application are using two different ASP.Net projects within your solution. To debug them in a single solution they'd need to be in the same ASP.Net website.
Upvotes: 2