When a Silverlight application is running on the localhost, you can attach the debugger to the application process or processes and step through code, set breakpoints, and examine the content of variables while the code is running.
To debug a silverlight application which is running on IIS,For that we should perform following steps:
-> Goto Debug menu->select Attach to Process
->Attach to process dialog box opens
->Locate running applications from title and Type columns in the list of running processes.
->Name of the application will show in Title column
->Silverlight process will show in Type column
->Select both processes and click attach process.
Now you can debug your silverlight application.