2

I am having issues when publishing my web app to our server with some resources not being loaded.

To rule out any possible mistake by myself I tested by creating a totally new Web Application from the template: Visual C#->Web->ASP.NET Web Forms Application and publishing this.

When running locally everything works fine but the published app gets 404 errors for a bunch of resources namely:

  • bundles/WebFormsJs?v=q9E9g87bUDaS624mcBuZsBaM8xn2E5zd-f4FCdIk2cA1
  • bundles/modernizr?v=jmdBhqkI3eMaPZJduAyIYBj7MpXrGd2ZqmHAOSNeYcg1
  • bundles/MsAjaxJs?v=J4joXQqg80Lks57qbGfUAfRLic3bXKGafmR6wE4CFtc1
  • Content/css?v=f5ydPh92LWsttS1MEc8JZmFtAgT6RUaer_jy37xBkQs1 (twice)
  • bundles/MsAjaxJs?v=J4joXQqg80Lks57qbGfUAfRLic3bXKGafmR6wE4CFtc1
  • bundles/WebFormsJs?v=q9E9g87bUDaS624mcBuZsBaM8xn2E5zd-f4FCdIk2cA1

Needless to say without these files a whole bunch of stuff doesn't work right.

I am using Visual Studio 2012 Ultimate v11.0.51106.01 Update 1 on Framework 4.5.50709 on Windows 7 Professional with SP1 (32bit). The server is Windows Server 2008 Enterprise with SP2 (32bit) and has Framework 4.5 installed (I'm not sure how to find the exact version number?).

N.B. The bundles directory does not exist either in the published app or the local source.

When running locally it is running in the IIS Express instance started automatically by Visual Studio.

I am thinking it must be a server configuration issue and Google is turning a blank for me.

Has anyone found a solution for this issue?

4

2 回答 2

0

我们通过制作具有 IIS7.5 而不是 7.0 的新 Windows 服务器 2008 R2(显然与 SP2 不同?)解决了这个问题。

于 2013-01-25T10:37:49.317 回答
0

在 web.config 中添加以下给定标签,然后它将开始工作。

这解决了我的问题

<system.webServer>
    <modules>
      <remove name="Session" />
      <add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add name="BundleModule" type="System.Web.Optimization.BundleModule" />
    </modules>
    <security>
      <requestFiltering allowDoubleEscaping="true"/>
    </security>
</system.webServer>
于 2015-10-08T12:40:06.607 回答