Debugging ECMAScript in SharePoint 2010

One of my favorite new features of SharePoint 2010 is the ECMAScript object model

OK, the .NET and Silverlight client object models are also neat but they don’t come close to the ECMAScript object model. And don’t even get me started on “Sandboxed solutions” - they are great but WHY would you use a sandboxed solution when you can do even more with client side scripting?

So since I think it is so great, I want to tell you how to change the scripts from being “minified” to readable.

SharePoint ships with debug versions of all scripts.  If you read this article on MSDN, you're told:

“You can override this default setting and use the debug .js files by adding <deployment retail="false" /> to the system.web section of the web.config file, which is located in the %inetpub%\wwwroot\wss\VirtualDirectories\80 directory.”

Not so fast… if you do this, you will see an error because the “deployment section” is marked as “MachineOnly” in machine.config.

You can read an old bug report here: http://connect.microsoft.com/VisualStudio/feedback/details/104338/deployment-section-definition-incorrectly-marked-machineonly-in-shipping-machine-config

So what you have to do is to open up your machine config and remove the attribute:

allowDefinition="MachineOnly" from <section name="deployment" type="System.Web.Configuration.DeploymentSection

Happy debugging!


Posted Jul 28 2010, 09:42 AM by Jonas Nilsson

Add a Comment

Please sign into Bamboo Nation to leave a comment.

Blogs

Bamboo Nation, media sponsor of:

SPTechCon

Subscribe by Email

Syndication

Bamboo Nation Almost Everywhere

Follow Bamboo Nation on:

Twitter Logo

Bamboo Now in Alltop!

        Featured in Alltop

Blue Rooster Cycling

Bamboo is a proud sponsor of the Blue Rooster Cycling Team.
Blue Rooster Cycling Logo

Bamboo Solutions Corporation, 2002-2010