我可以在我的开发机器上运行该应用程序。当我将它发布到我的生产机器时,它不起作用。表示禁止使用 .axd 文件。
有任何想法吗?我越来越沮丧!
编辑:
作为测试,我已更改为“storage=file;”。当我向服务器发送生成图表的请求时,图表实际上出现在我的文件夹中 - 它只是没有在请求中被发送回浏览器。
啊!到底是怎么回事!?!?!
添加了 web.config
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=memory;"/>
</appSettings>
<connectionStrings>
<add name="VS265178_1ConnectionString" connectionString="Data Source="HIDDEN"/>
</connectionStrings>
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false" />
</httpHandlers>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".CFCASPXFORMSAUTH" defaultUrl="Default.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<machineKey validationKey="HIDDEN" decryptionKey="HIDDEN" validation="SHA1"/>
<!-- Custom Membership Provider Configuration -->
<membership defaultProvider="CFMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="CFMembershipProvider" passwordFormat="Clear" type="HIDDEN" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" writeExceptionsToEventLog="false"/>
</providers>
</membership>
<profile defaultProvider="CFProfileProvider">
<providers>
<add name="CFProfileProvider" type="HIDDEN"/>
</providers>
</profile>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration>