【发布时间】:2019-01-18 02:20:42
【问题描述】:
Server Error in '/' Application.
'respond' is not a valid script name. The name must end in '.js'.
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.InvalidOperationException: 'respond' is not a
valid script name. The name must end in '.js'.
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.
[InvalidOperationException: 'respond' is not a valid script name. The name
must end in '.js'.]
System.Web.UI.ScriptReference.GetDebugName(String releaseName) +139
System.Web.UI.ScriptReference.ShouldUseDebugScript(String releaseName,
Assembly assembly, Boolean isDebuggingEnabled, Assembly currentAjaxAssembly) +31
System.Web.UI.ScriptReference.DetermineResourceNameAndAssembly(ScriptManager scriptManager, Boolean isDebuggingEnabled, String& resourceName, Assembly& assembly) +98
System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip, Boolean useCdnPath) +104
System.Web.UI.ScriptReference.GetUrlInternal(ScriptManager scriptManager, Boolean zip, Boolean useCdnPath) +603
System.Web.UI.ScriptReference.GetUrl(ScriptManager scriptManager, Boolean zip) +182
System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1 uniqueScripts) +204
System.Web.UI.ScriptManager.RegisterScripts() +465
System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +124
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +9883750
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1069
我不知道是什么导致了这个错误,我已经用谷歌搜索了很多网站,但我根本找不到导致它的原因或它的原因在哪里。我在微软网站上关注本教程 [Link] 我已经完成了所有工作,直到它要求您下载主题并添加到项目中。我已经这样做了,当它说要运行代码时,就会出现这个错误。在过去的两天里,我和我的朋友一直被这个错误困扰,我们无法弄清楚。
【问题讨论】:
-
这听起来可能是您的
中的错误路径引用。验证所有引用都是有效的文件路径。 -
我在同一个教程中遇到了同样的错误,除了我下载了代码。有许多 Nuget 包需要更新,但我想我做到了,但错误仍然存在。我想我会继续完成教程并以这种方式构建示例。
-
我下载的代码可以工作了。我从Getting Started with ASP.NET 4.5 Web Forms and Visual Studio 2013 - Wingtip Toys in C# for Visual Studio 2013 下载然后我使用 SSMS 删除数据库 (mdf) 文件(不要使用文件资源管理器删除数据库)然后我将连接字符串中的服务器修改为 '(localdb)\MSSQLLocalDB' 然后我做了不更新 Nuget 包。这行得通,但我不知道从头开始构建网站时该怎么做。
标签: javascript html visual-studio visual-studio-2010 visual-studio-2017