Does the new asp:chart control need to be installe

2019-05-09 22:58发布

问题:

  • I have installed the new asp:chart control on my machine and have built an app that uses it.
  • All is working well so far. Now I want to deploy my app in a hosted environment.
  • If my hosting provider doesn't have the asp:chart control installed can I get my app to work by putting the .dll in the bin folder?

    (I guess I am asking if it has to be found in the Gac)

回答1:

Apart from deploying the assembly to the bin folder, you also need to configure a folder with write permission to temporarily store the chart images.

In web.config under

<appSettings>
    <add key="ChartImageHandler" value="storage=file;timeout=20;dir=D:\TEMPDUMP\;"/>
    ...


回答2:

It does not have to be in the GAC. Applications will look in the GAC if it can't find it in the bin folder.



回答3:

Just put the .dll in the bin folder and it will work.



回答4:

You can also take a look at OpenFlashChart, the charts look prettier



回答5:

There's one more step: Before you deploy it to your server, you must create a directory to use as a temporary directory for the chart images on the server and you must write it in in web.config, like this:

<add key="ChartImageHandler" value="storage=file; timeout=20; dir=c:\tmpimg;" />

You can use any directory that you want. Don't forget to set the right permissions in this directory. Keep security aways in mind.