'bootstrap'不是有效的脚本名称。名称必须以'.js'结尾 [英] 'bootstrap' is not a valid script name. The name must end in '.js'

查看:133
本文介绍了'bootstrap'不是有效的脚本名称。名称必须以'.js'结尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习asp.net,所以我正在尝试从MSDN建立一个名为Wingtip Toys的项目。该项目是在VS 2013上开发的,我有VS 2012.当我尝试按照这里我在浏览器中收到运行时错误。



I'm learning asp.net and so I'm trying to build up the project named "Wingtip Toys" from MSDN. The project is developed on VS 2013 and I have VS 2012. When I try to add the bootstrap as per instruction from here I get the error on running time in browser.

Server Error in '/' Application.

    'bootstrap' 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: 'bootstrap' is not a valid script name. The name must end in '.js'.





当我在母版页上添加.js时,它会将我带到另一个错误,我还将css文件添加到Bundle.config但仍然是相同的结果。我已经将Nuget包用于Jquery.js错误,但是我还是无法对此进行排序。



when I add the .js on the master page it carry me to another error, I also add the css file to Bundle.config but still the same result. I have already Nuget package availble as for the Jquery.js error but I'm unable to sort this out yet.

推荐答案

该教程目标 Microsoft .NET Framework 4.5.2。 [ ^ ]您需要安装它并在创建此项目时定位相同的框架,另请注意,您需要安装许多nuget包。
That tutorial target Microsoft .NET Framework 4.5.2.[^] You need to installed it and target the same framework when you create this project and also note that there are many nuget packages you need to install.
<packages> 
  <package id="Antlr" version="3.4.1.9004" targetframework="net452" /> 
  <package id="AspNet.ScriptManager.bootstrap" version="3.0.0" targetframework="net452" /> 
  <package id="AspNet.ScriptManager.jQuery" version="1.10.2" targetframework="net452" /> 
  <package id="bootstrap" version="3.0.0" targetframework="net452" /> 
  <package id="elmah" version="1.2.2" targetframework="net452" /> 
  <package id="elmah.corelibrary" version="1.2.2" targetframework="net452" /> 
  <package id="EntityFramework" version="6.1.1" targetframework="net452" /> 
  <package id="jQuery" version="1.10.2" targetframework="net452" /> 
  <package id="Microsoft.AspNet.FriendlyUrls" version="1.0.2" targetframework="net452" /> 
  <package id="Microsoft.AspNet.FriendlyUrls.Core" version="1.0.2" targetframework="net452" /> 
  <package id="Microsoft.AspNet.Identity.Core" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.AspNet.Identity.EntityFramework" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.AspNet.Identity.Owin" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.AspNet.Providers.Core" version="2.0.0" targetframework="net452" /> 
  <package id="Microsoft.AspNet.ScriptManager.MSAjax" version="5.0.0" targetframework="net452" /> 
  <package id="Microsoft.AspNet.ScriptManager.WebForms" version="5.0.0" targetframework="net452" /> 
  <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetframework="net452" /> 
  <package id="Microsoft.AspNet.Web.Optimization.WebForms" version="1.1.3" targetframework="net452" /> 
  <package id="Microsoft.Owin" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Security" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Security.Cookies" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Security.Facebook" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Security.Google" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Security.MicrosoftAccount" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Security.OAuth" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Owin.Security.Twitter" version="2.1.0" targetframework="net452" /> 
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetframework="net452" /> 
  <package id="Modernizr" version="2.6.2" targetframework="net452" /> 
  <package id="Newtonsoft.Json" version="6.0.3" targetframework="net452" /> 
  <package id="Owin" version="1.0" targetframework="net452" /> 
  <package id="Respond" version="1.2.0" targetframework="net452" /> 
  <package id="WebGrease" version="1.5.2" targetframework="net452" /> 
</packages>


我遇到了同样的问题,我刚用包管理器重新安装了bootstrap包:



PM> uPDATE-Package AspNet.ScriptManager.bootstrap -reinstall
I had the same problem, I just reinstalled bootstrap package with the package manger console:

PM> uPDATE-Package AspNet.ScriptManager.bootstrap -reinstall


< appsettings>

< add key =ValidationSettings:UnobtrusiveValidationModevalue =None/> ;

< / appsettings>



将此添加到你的web.config
<appsettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appsettings>

add this to u r web.config


这篇关于'bootstrap'不是有效的脚本名称。名称必须以'.js'结尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆