Pages

Tuesday, November 27, 2012

SharePoint 2013: Debug your SharePoint App

In SharePoint 2013 app development, you need to run the app from visual studio to debug. However as you debug and you need to make some changes in html or JavaScript, you might wonder that you need to stop debugging, make changes and redeploy the app again. But there’s simplest solution exists.

Unproductive Approach

You might be aware of the following steps which might take long time to debug and make changes:

  1. Run the app from Visual Studio in debug mode (with F5).
  2. Debug your JavaScript and you’ve found you need to make changes
  3. Stop the debug and make changes
  4. Rerun the app from Visual Studio with F5

But there’s simplest approach exists for debugging as described next.

 

Productive Approach

You may not know that you don’t need to stop debugging to make changes. You can make changes while the app is running and then refresh the page in the browser. You will get your changes on refreshing/reloading the page. So the new steps are:

  1. Run the app from Visual Studio in debug mode (with F5).
  2. Debug your javascript and you’ve found you need to make changes
  3. Make those changes in Visual Studio without stopping the app.
  4. Refresh the page in Browser, you will get the changes (HTML, JavaScript) immediately.

 

Conclusion

Using the second (productive approach) approach, you can develop and debug faster. However, if you make any setting changes like feature changes or appmanifest changes, you need to stop debugging and rerun again.