首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >发布使用捆绑的MVC4.0项目(<compilation debug="false“targetFramework=" 4.0 ">)

发布使用捆绑的MVC4.0项目(<compilation debug="false“targetFramework=" 4.0 ">)
EN

Stack Overflow用户
提问于 2013-07-20 09:20:42
回答 1查看 889关注 0票数 2

以下是我的bundels:

代码语言:javascript
运行
复制
public static void RegisterBundles(BundleCollection bundles)
{
    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                "~/Bootstrap/assets/js/jquery.js"));

    bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                "~/Bootstrap/assets/js/bootstrap-transition.js",
                "~/Bootstrap/assets/js/bootstrap-alert.js",
                "~/Bootstrap/assets/js/bootstrap-modal.js",
                "~/Bootstrap/assets/js/bootstrap-dropdown.js",
                "~/Bootstrap/assets/js/bootstrap-scrollspy.js",
                "~/Bootstrap/assets/js/bootstrap-tab.js",
                "~/Bootstrap/assets/js/bootstrap-tooltip.js",
                "~/Bootstrap/assets/js/bootstrap-popover.js",
                "~/Bootstrap/assets/js/bootstrap-button.js",
                "~/Bootstrap/assets/js/bootstrap-collapse.js",
                "~/Bootstrap/assets/js/bootstrap-carousel.js",
                "~/Bootstrap/assets/js/bootstrap-typeahead.js",
                "~/Bootstrap/assets/js/bootstrap-affix.js",
                "~/Bootstrap/assets/js/application.js",
                "~/Bootstrap/assets/js/bootstrap.js"
                ));

}

下面是我的_Layout页面的部分内容:

代码语言:javascript
运行
复制
@Scripts.Render("~/bundles/bootstrap")
... 

当我尝试运行这个应用程序时,我得到类似如下的js错误

代码语言:javascript
运行
复制
An Error has occurred in the script on this page
Object Expected
URL   http://servername/AppName/bundles/bootstrap?v=asdjisdjsincdjijadosJISJDIS_idosd 

这里也问了一个类似的问题:Why is my CSS bundling not working with a bin deployed MVC4 app?

我尝试按照我引用的问题的建议将此配置添加到我的web.config文件中

代码语言:javascript
运行
复制
<modules runAllManagedModulesForAllRequests="true">
  <remove name="BundleModule" />
  <add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</modules>

我仍然收到同样的错误。

如果有什么不清楚的地方,请让我知道,我会详细说明。谢谢

EN

回答 1

Stack Overflow用户

发布于 2013-09-19 20:04:45

捆绑文件夹是否存在于您的应用程序中?

尝试:

代码语言:javascript
运行
复制
bundles.Add(new ScriptBundle("~/Bootstrap/assets/js/jquery").Include(
            "~/Bootstrap/assets/js/jquery.js"));

bundles.Add(new ScriptBundle("~/Bootstrap/assets/js/bootstrap").Include(

http://www.mvccentral.net/Story/Details/articles/kahanu/stylebundle-403-error-solved

MVC CSS not rendering in Visual Studio When debugging

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17757711

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档