简体   繁体   English

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

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

I know this has been asked a hundred times before, but alas, no solutions here work for this NuGet bug in VS2012. 我知道这已经被问过一百次了,但是,可惜的是,VS2012中的NuGet错误在这里没有解决方案。
All I did was upgrade to the latest Ajax toolkit and my site is broken as a result. 我所做的只是升级到最新的Ajax工具包,结果导致我的网站损坏了。 I've tried uninstalling the NuGet package and reinstalling everything with no joy. 我尝试卸载NuGet程序包,然后重新安装所有程序,但都没有高兴。 I have jQuery, jQueryUI, and the site builds just fine, however, at runtime, it crashes with this dreaded error. 我有jQuery,jQueryUI,并且站点构建良好,但是,在运行时,它因该可怕的错误而崩溃。 adding .js to the end creates more errors, and so forth. 最后添加.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>

All references are pointing correctly as far as I can tell. 据我所知,所有参考文献均正确指向。

I've "cleaned" the solution, deleted bin folder, etc, etc. no joy there either. 我已经“清理”了解决方案,删除了bin文件夹等,等等。 I've copied and pasted other solutions (no joy). 我已经复制并粘贴了其他解决方案(不高兴)。

Version: Microsoft Visual Studio Professional 2012 Version 11.0.61030.00 Update 4 Microsoft.NET Framework Version 4.5.51641 Windows 8.1 (updated as of today). 版本:Microsoft Visual Studio Professional 2012版本11.0.61030.00更新4 Microsoft.NET Framework版本4.5.51641 Windows 8.1(今天更新)。 I'm at wit's end here - should I reinstall VS? 我在这里机智-我应该重新安装VS吗?

OK - I figured out the most painless way of doing this. 好的-我想出了最轻松的方法。 I restored a backup (good idea to make backups) of the site in question. 我恢复了有关站点的备份(创建备份的好主意)。 Before loading it into VS2012, I deleted the \\packages\\ folder completely. 在将其加载到VS2012中之前,我完全删除了\\ packages \\文件夹。 Then, I opened the project and VS restored the \\packages\\ folder and all references (by dumb luck, I discovered that VS will rebuild things for you). 然后,我打开了项目,VS还原了\\ packages \\文件夹和所有引用(运气不好,我发现VS将为您重建内容)。 I still had the old versions of jQuery, jQUI, ACTK, etc. and tested to make sure everything worked. 我仍然有旧版本的jQuery,jQUI,ACTK等,并经过测试以确保一切正常。 The solution this time around is to avoid the NuGet GUI altogether (there is some sort of bug whereby it will not uninstall things properly). 这次的解决方案是完全避免使用NuGet GUI(存在某种错误,导致无法正确卸载东西)。 I went to the command line instead and typed in the appropriate commands to install the latest versions (the old versions were removed properly this time). 我改用命令行,然后键入适当的命令以安装最新版本(这次正确删除了旧版本)。 I cleaned & rebuilt the solution and it works just fine now. 我清理并重建了解决方案,现在效果很好。 (no editing of .config files required). (无需编辑.config文件)。

暂无
暂无

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

相关问题 &#39;jquery&#39;不是有效的脚本名称。 名称必须以&#39;.js&#39;结尾 - 'jquery' is not a valid script name. The name must end in '.js' JQuery的。 按属性名称删除元素。 怎么样? - JQuery. Remove element by attribute name. How? Jquery,如果URL末尾的hashtag与类名匹配,则激活脚本 - Jquery, activate script if hashtag on end of URL matches a class name 我的文件名与我的菜单名相同。 当我单击菜单名称时,jquery 采用文件名 - My file name is the same as my menu name. jquery takes the file name when I click the menu name 如何使用类名仅在一个元素上运行jquery函数。 有更多的元素使用相同的类 - how to run jquery function only on one element using class name. there is more element using same class 当我从IIS Express切换到具有完全限定名称的IIS时。 发生此jquery错误。 为什么? - When I switch from IIS Express to IIS with fully qualified name. There is this jquery error happening. Why? 用于切换特定div的jQuery切换函数(而不是所有具有相同类名的div。) - jQuery toggle function for toggling specific div (and not all div with same class name.) 获取变量名称。 javascript“反思” - Get variable name. javascript “reflection” JSON“ SyntaxError:意外令牌&#39;&&#39;。 应该是一个属性名称。” - JSON “SyntaxError: Unexpected token '&'. Expected a property name.” 当我有部分名称时,getelementsbyname(在Ajax html响应中)。 - getelementsbyname (in an Ajax html response) when I have a partial name.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM