1

It throws exception when i try to combine scripts in ScriptRegistrar (Telerik version 2011.3.1115) with this code:

@Html.Telerik().ScriptRegistrar().DefaultGroup(c => c.DefaultPath("~/Scripts/").Add("jquery.tools.min.js").Add("Common.js?v=1.1").Add("date.js").Add("jquery.validate.min.js").Add("jquery.validate.unobtrusive.min.js").Add("jquery.notty.js").Combined(true))

when i remove combine (.Combined(true)) works perfectly (expect i don't have script combined).

exception is this:

Server Error in '/' Application.
Illegal characters in path.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Illegal characters in path.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Illegal characters in path.]
   System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str) +9360949
   System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) +73
   System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath) +43
   System.IO.File.GetLastWriteTimeUtc(String path) +107
   System.Web.Compilation.TimeStampChecker.AddFileInternal(String virtualPath, String path) +33
   System.Web.Hosting.MapPathBasedVirtualFile.Open() +46
   System.Web.Hosting.VirtualPathProvider.OpenFile(String virtualPath) +31
   Telerik.Web.Mvc.Infrastructure.Implementation.VirtualPathProviderWrapper.ReadAllText(String virtualPath) +120
   Telerik.Web.Mvc.Infrastructure.Implementation.WebAssetGroupReader.Read(WebAssetGroup group) +286
   Telerik.Web.Mvc.WebAssetHttpHandler.ProcessRequest(HttpContextBase context) +340
   Telerik.Web.Mvc.Infrastructure.HttpHandlerBase.ProcessRequest(HttpContext context) +63
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

1 Answer 1

3

"Common.js?v=1.1" is not a valid file path. The ScriptRegistrar needs a valid path because it has to read the file from the file system.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.