Skip to content

How to make SharePoint use debug scripts?

July 26, 2013

Recently I have setup a new machine and wanted to dig into some standard SharePoint scripts. The thing is that SharePoint has used all normal minimized scripts (sp.js, core.js) while I want it to run sp.debug.js and code.debug.js

To get the answer we need to get into the component called ScriptLink.

If your script is registered as ScriptLink (as most sharepoint scripts are), then the ScriptLink class can automatically use .debug. scripts if ScriptManager.iSDebuggingEnabled is true.

http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.isdebuggingenabled.aspx

ScriptManager.IsDebugging enabled follows the following logic.

If there is <deployment retail=”true”> – return false.

Else if the script mode is not auto and not inherint, return (ScriptMode = Debug)

Else

return what is set in <compilation debug=”xxx”…/>

So for developer farm the easiest thing to do is go to web.config and set there

<system.web>

<compilation batch="false" debug="true">
      <assemblies>

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: