javascript - MVC 4 找不到 "Scripts"文件夹

标签 javascript jquery asp.net-mvc visual-studio-2012

我的项目文件夹“Scripts”有问题。出于某种原因,当我在 VS 2012 中运行该程序时,它给了我一个异常(exception):

Invalid file name for file monitoring: 'c:\users\user\documents\visual studio 2012\Projects\project1\project\Scripts'. Common reasons for failure include: - The filename is not a valid Win32 file name. - The filename is not an absolute path. - The filename contains wildcard characters. - The file specified is a directory. - Access denied.

无法加载其中的 .js 文件。为什么会这样? (顺便提一下,我尝试重新启动并清除了 Temp 文件夹)。

编辑: 这是抛出异常的代码。

        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.unobtrusive*",
                    "~/Scripts/jquery.validate*"));
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));

最佳答案

我使用 Basic 模板创建了新项目。它解决了这个问题。 (以前的项目模板是“空”)。 :)

关于javascript - MVC 4 找不到 "Scripts"文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18512644/

相关文章:

jquery - 如何在 html 表中选择第三个 tr 的 td?

.net - 有没有办法在 ASP.net 中设置 Tab 顺序?

asp.net-mvc - 基于 HTML5 的文档(doc/xls)查看器和编辑器 : What are my options?

javascript - "Fixing"来自 MySQL 的 JSON

javascript - '未捕获的语法错误 : Unexpected Token }' when trying to access a function

javascript - 在 ASP.net MVC Signalr 中连接客户端服务器

c# - 在回发时从服务器端调用 javascript

c# - 使用 C#/ASP.NET MVC 进行逐帧 MJPEG 流式传输

javascript - Bootstrap 选择器显示 :Uncaught TypeError: Cannot set property '_menu' of undefined

javascript - 在打印 div 上包含 css 样式