2012-03-08 42 views
1

它拋出異常,當我嘗試腳本ScriptRegistrar結合(Telerik的版本2011.3.1115)使用此代碼:Telerik的MVC3 ScriptRegistrar結合例外

@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)) 

當我刪除合併(.Combined(真))的作品完美(期望我沒有腳本組合)。

例外是這樣的:

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 

回答

3

「?Common.js V = 1.1」 不是一個有效的文件路徑。 ScriptRegistrar需要一個有效的路徑,因爲它必須從文件系統中讀取文件。