title: How do I make ToolkitScriptManager get a newer version of AJAX scripts?
body: <p>I'm trying to upgrade the version of AjaxControlToolkit that we're using in a ASP.NET 3.5 project. It builds fine but when I load a page with an AjaxControlToolkit control on it gives the error:</p>
  
  <blockquote>
    <p>JavaScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.</p>
  </blockquote>
  
  <p>We are using a class that extends ToolkitScriptManager with a reference to AjaxControlToolkit as our ScriptManager.</p>
  
  <p>Having looked at the javascript, I can tell that the version that's being included does not contain some of the updates that the .js source files included in the toolkit download have. I'm not sure where the ToolkitScriptManager is getting its AJAX .js files from but I need to find a way to force it to use the newer versions. </p>
  
  <p>Simply including them as embedded resources in the project has not worked.</p>
  
  <p>I am building this project in VS2008 3.5 SP1 (as required by client). I am trying to build AjaxControlToolkit from the source code, as there are a few extensions which we need to apply to the Toolkit controls.</p>
  
  <p>I would be happy to provide further details if they're helpful.</p>
  
  <p>EDIT: As it turns out, I had commented out the line <code>ApplyAssembly(e.Script, false);</code> in my copy of ToolkitScriptManager. Putting it back in caused the execution to instead fail in <code>GetBaseUrl</code> with an <code>InvalidOperationException</code>:</p>
  
  <blockquote>
    <p>Assembly 'AjaxControlToolkit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' does not contain a Web resource with name 'MicrosoftAjax.js'.</p>
  </blockquote>