I have had the same problem, but from a different scenario:
For me, using latest version from SVN causes this same error, regardless of the RenderScripts value. Instead for me it only works if cleanResourceUrl is disabled.
Further info:
- Using the version from NuGet works without problems. Could there be some regression between NuGet version and latest?
- I say latest but noticed this since around 22nd December - only reporting now because of the holidays in the way, sorry!
- Creating a similar project (empty Web Application with MVC, Web Forms and Web API - all latest versions against .NET 4.5) and then adding reference to the Ext.NET DLLs (including utilities, transformer etc) and applying the same web.config, global.asax etc doesn't work.
In a bit more detail:
I've tried to look at many things like global.asax, app start and also trying to get my web.config down to bare minimum and I've not had any luck...
Here is what I have (a copy/paste from the one created by NuGet I think, possibly with some additional changes after that):
web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" />
</configSections>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="Ext.Net" />
<add namespace="Ext.Net.MVC" />
</namespaces>
<controls>
<add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" />
</controls>
</pages>
<httpHandlers>
<add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />
</httpHandlers>
<httpModules>
<add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net" />
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net" />
</modules>
<handlers>
<add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" />
</handlers>
</system.webServer>
<extnet theme="Gray" scriptMode="Debug" />
</configuration>
global.asax
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
ExtNetConfig.RegisterRoutes(RouteTable.Routes);
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
// Skip authenticating all ext.axd embedded resources (.js, .css, images)
if (HttpContext.Current.Request.FilePath.EndsWith("/ext.axd"))
{
HttpContext.Current.SkipAuthorization = true;
}
}
}
ExtNetConfig (note it is called from global.asax unlike the NuGet version which uses WebActivator)
public static class ExtNetConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
// Ignore all ext.axd embedded resource paths
routes.IgnoreRoute("{extnet-root}/{extnet-file}/ext.axd"); // NuGet uses this
routes.IgnoreRoute("{exclude}/{extnet}/ext.axd"); // some examples use this... Hence I have added both for now...
// Add http://example.com/extnet/ Route
routes.MapRoute(
"ExtNet", // Route name
"extnet/{action}/{id}", // URL with parameters
new { controller = "ExtNet", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
}
With the above, I use the default Ext.NET.default.aspx that comes with NuGet and it fails with this error in the browser console:
"NetworkError: 404 Not Found - http://localhost:8124/extjs/ext-all-js/ext.axd?v=21110"
"NetworkError: 404 Not Found - http://localhost:8124/extnet/extnet-all-js/ext.axd?v=21110"
ReferenceError: Ext is not defined
So Ext is not defined because the ext.axd resource is returning not found.
Note, these settings/code changes noted above were duplicated from the NuGet version which works. I have tinkered with them trying to get them to work so maybe I have missed something. The main differences are that
- Global.asax I invoked the ExtNetConfig manually
- Web.config I don't have/need a runtime section
In addition, the above code DOES work, if the following change is made:
Disable cleanResourceUrl in web.config:
<extnet scriptMode="Debug" cleanResourceUrl="false" />
So it feels like I have set it up right (I can't spot anything I have missed).
Is this a regression between the NuGet version and SVN version? (If it helps, I had this problem around 22nd December as well - but after a few days holiday only now going back to it.)