2010-01-22 13 views

risposta

47

Questo è quello che serve per ASP .NET 4.0/IIS 7.5 su Windows 7:

Il file web.config deve contenere quanto segue:

<appSettings> 
    <add key="ChartImageHandler" value="storage=file;timeout=20;" /> 
</appSettings> 


<compilation targetFramework="4.0"> 
<assemblies> 
    <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
</assemblies> 
</compilation> 

<system.webServer> 

<handlers> 
     <add name="ChartImg" verb="*" 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> 

è necessario anche questo alla parte superiore della pagina aspx:

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %> 

Spero che questo aiuti

1

Non so nulla su MSCharts, ma direi prova a cambiare l'AppPool per l'app in "Classic .NET AppPool".

In alternativa, potrebbe essere necessario modificare il proprio web.config per aggiungere il gestore lì. Vedi Rick Strahl's post here.

+0

non posso usare app pool classica, grazie per la risposta. Studierò il post di Rick Strahl. – Danil

9

La soluzione era in configurazione Web. IIS7 richiesto per scrivere gestori all'interno di system.webserver ma non nel system.web. Quindi ho appena spostato il gestore e aggiungo l'attributo nome quando è diventato necessario.

+0

Grazie mille, mi sono strappato i capelli cercando di capirlo per ore. Grazie ancora. – will

+0

Grazie @ Danil ha funzionato! – Xenon

9

Come Danil detto, IIS7 richiede che si mette i gestori in

<system.webserver> 
    <handlers> 

Aggiungere le due righe di seguito dopo l'ultimo componente aggiuntivo gestisce

<add name="ChartImg" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,  System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
<add name="ReportViewer" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
Problemi correlati