“NetworkError:404 Not Found - http:// wcfjsproxydemo / bundles / modernizr?v = Vd40cG5fYxxjdknf_y9ilK-zi7pnjL35tk9IAsOQgQc1”

时间:2013-12-17 11:04:44

标签: asp.net web iis-7

在IIS7下部署我的ASP.NET 4.5 Web窗体站点后,我收到了从VS2013运行时没有的错误。

从firebug浏览我的网站时出错:

"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/bundles/modernizr?v=Vd40cG5fYxxjdknf_y9ilK-zi7pnjL35tk9IAsOQgQc1"
modern...sOQgQc1
"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/Content/css?v=f5ydPh92LWsttS1MEc8JZmFtAgT6RUaer_jy37xBkQs1"
css?v=...7xBkQs1
"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/bundles/MsAjaxJs?v=J4joXQqg80Lks57qbGfUAfRLic3bXKGafmR6wE4CFtc1"
MsAjax...E4CFtc1
"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/bundles/WebFormsJs?v=q9E9g87bUDaS624mcBuZsBaM8xn2E5zd-f4FCdIk2cA1"
WebFor...dIk2cA1
TypeError: Sys.WebForms is undefined


...bForms.PageRequestManager._initialize('ctl00$ctl08', 'ctl01', [], [], [], 90, 'c...

wcfjsproxydemo (line 67)
POST http://intext.nav-links.com/util/intexteval.pl?op=eval&x=3&xop=eval&rnum=911043

200 OK
        214ms   
intext...inks=3& (line 3039)

我看到我的网站没有风格。

我的网站应该更改哪些内容?

我的web.config

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-WCFJSproxyDemo-20130722004707;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-WCFJSproxyDemo-20130722004707.mdf" />
  </connectionStrings>
  <system.web>
    <compilation targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization" />
      </namespaces>
    <controls><add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /></controls></pages>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
    </authentication>
    <profile defaultProvider="DefaultProfileProvider">
      <providers>
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </profile>
    <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>
    <roleManager defaultProvider="DefaultRoleProvider">
      <providers>
        <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </roleManager>
    <!--
            If you are deploying to a cloud environment that has multiple web server instances,
            you should change session state mode from "InProc" to "Custom". In addition,
            change the connection string named "DefaultConnection" to connect to an instance
            of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
      -->
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </entityFramework>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="WCFJSproxyDemo.Service.WCFJSproxyDemoBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>   
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>
      <service name="WCFJSproxyDemo.Service.DemoWCFService">
        <endpoint address="" behaviorConfiguration="WCFJSproxyDemo.Service.WCFJSproxyDemoBehavior" binding="webHttpBinding" contract="WCFJSproxyDemo.Service.IDemoWCFService">
        </endpoint>
      </service> 
    </services>
  </system.serviceModel>
    <system.webServer>
        <defaultDocument>
            <files>
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.html" />
                <remove value="index.htm" />
                <remove value="Default.asp" />
                <remove value="Default.htm" />
                <add value="TestWCFService.aspx" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

2 个答案:

答案 0 :(得分:1)

我修好了。

在这个问题上工作几个小时之后,我找到了blog只有一个想法:

<modules runAllManagedModulesForAllRequests="true">  
  <remove name="BundleModule" />  
  <add name="BundleModule" type="System.Web.Optimization.BundleModule" />  
</modules>

Optimization.cs

bundles.Add(new StyleBundle("~/Static/css/stylesheets.css")
                .Include(
                        "~/Static/stylesheets/base.css",
                        "~/Static/stylesheets/layout.css"
                )
            );



            bundles.Add(new ScriptBundle("~/Static/js/script.js")

                .Include("~/Static/js/jquery.refineslide.min.js", 
                         "~/Static/js/script.js"));

Root.Master

<asp:ContentPlaceHolder ID="cssBundle" runat="server">
     <%= System.Web.Optimization.Styles.Render("~/Static/css/stylesheets.css") %>
</asp:ContentPlaceHolder>
.
.
.
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
      <%= System.Web.Optimization.Scripts.Render("~/Static/js/script.js") %>
</asp:ContentPlaceHolder>  

答案 1 :(得分:0)

在ASP.net表单中, 您只需将webconfig中的模块更改为以下

即可
<modules runAllManagedModulesForAllRequests="true">  
  <remove name="BundleModule" />  
  <add name="BundleModule" type="System.Web.Optimization.BundleModule" />  
</modules>