相关疑难解决方法(0)

MVC捆绑 - 无法加载资源

可能是什么导致了这个?我正在使用DurandalJS项目,该项目可以在本地构建和运行.当我尝试部署到Azure网站时,该应用程序发布但在浏览器中失败:

无法加载资源:服务器响应状态为404(未找到) http://appsite.azurewebsites.net/Scripts/vendor.js?v=KJCisWMhJYMzhLi_jWQXizLj9vHeNGfm_1c-uTOfBOM1

我没有定制任何捆绑.

我的捆绑配置:

public class BundleConfig
{
    // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
    public static void RegisterBundles(BundleCollection bundles)
    {
        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*"));

        // Use the development version of Modernizr to develop with and learn from. Then, when you're
        // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));

        bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                    "~/Content/themes/base/jquery.ui.core.css",
                    "~/Content/themes/base/jquery.ui.resizable.css",
                    "~/Content/themes/base/jquery.ui.selectable.css",
                    "~/Content/themes/base/jquery.ui.accordion.css",
                    "~/Content/themes/base/jquery.ui.autocomplete.css",
                    "~/Content/themes/base/jquery.ui.button.css",
                    "~/Content/themes/base/jquery.ui.dialog.css", …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc azure bundler azure-web-sites durandal

13
推荐指数
2
解决办法
3万
查看次数

MVC:我已经部署了我的应用程序,但CSS仅在我登录时才有效

我已经部署了我的MVC应用程序但是当我从IIS浏览时,我发现表单身份验证似乎阻止了CSS.这不会发生在我的开发服务器上.为什么会这样?我的主页看起来像这样;

<head id="Head1" runat="server">
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
    <script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.js" type="text/javascript" language="javascript"></script>
    <script src="http://nje.github.com/jquery-tmpl/jquery.tmpl.js" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/jquery.form.js")%>" type="text/javascript"></script>
    <!-- note that the order scripts are included in is important -->
    <script src="<%=Url.Content("~/Scripts/jquery.Validate.js")%>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/MicrosoftMvcJQueryValidation.js")%>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/ConfusedValidation.js")%>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/Awesome.js")%>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/MicrosoftAjax.debug.js") %>" type="text/javascript"></script>  
    <script src="<%=Url.Content("~/Scripts/MicrosoftMvcAjax.debug.js") %>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/jquery.jcacher-1.0.0.min.js")%>" type="text/javascript"></script>
    <link href="<%=Url.Content("~/Content/jquery.ui.autocomplete.css")%>" rel="stylesheet" type="text/css" />

    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/overcast/jquery-ui.css" 
            type="text/css" rel="Stylesheet" class="ui-theme" />

    <link href="<%=Url.Content("~/Scripts/Awesome.css")%>" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud)

*编辑* 在Firebug中我得到了消息; …

css asp.net-mvc

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

asp.net-mvc ×2

azure ×1

azure-web-sites ×1

bundler ×1

css ×1

durandal ×1