繁体   English   中英

'jquery'不是有效的脚本名称。 名称必须以“ .js”结尾

[英]'jquery' is not a valid script name. The name must end in '.js'

我知道这已经被问过一百次了,但是,可惜的是,VS2012中的NuGet错误在这里没有解决方案。
我所做的只是升级到最新的Ajax工具包,结果导致我的网站损坏了。 我尝试卸载NuGet程序包,然后重新安装所有程序,但都没有高兴。 我有jQuery,jQueryUI,并且站点构建良好,但是,在运行时,它因该可怕的错误而崩溃。 最后添加.js会产生更多错误,依此类推。

    <ajaxToolkit:ToolkitScriptManager ID="tksm1" runat="server" EnableViewState="False">
        <Scripts>            
            <asp:ScriptReference Name="jquery" />
            <asp:ScriptReference Name="jquery.ui.combined" />
            <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
            <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
            <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
            <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
            <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
            <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
            <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
            <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
            <asp:ScriptReference Name="WebFormsBundle" />
            <asp:ScriptReference Path="~/Scripts/search.js" />
        </Scripts>
    </ajaxToolkit:ToolkitScriptManager>

据我所知,所有参考文献均正确指向。

我已经“清理”了解决方案,删除了bin文件夹等,等等。 我已经复制并粘贴了其他解决方案(不高兴)。

版本:Microsoft Visual Studio Professional 2012版本11.0.61030.00更新4 Microsoft.NET Framework版本4.5.51641 Windows 8.1(今天更新)。 我在这里机智-我应该重新安装VS吗?

好的-我想出了最轻松的方法。 我恢复了有关站点的备份(创建备份的好主意)。 在将其加载到VS2012中之前,我完全删除了\\ packages \\文件夹。 然后,我打开了项目,VS还原了\\ packages \\文件夹和所有引用(运气不好,我发现VS将为您重建内容)。 我仍然有旧版本的jQuery,jQUI,ACTK等,并经过测试以确保一切正常。 这次的解决方案是完全避免使用NuGet GUI(存在某种错误,导致无法正确卸载东西)。 我改用命令行,然后键入适当的命令以安装最新版本(这次正确删除了旧版本)。 我清理并重建了解决方案,现在效果很好。 (无需编辑.config文件)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM