Web Deploying - Using Config Files?
Hi All,
I am creating a win app that is deployed via Web/No Touch/Internet/Zero Deployment (pick a name, any name :) and am running into problems with the config file. My app uses a config file for settings etc that I don't want compiled, but when I run the program it doesn't appear to download the config autmagically... Do I have to hard-code getting the config or is there something I am missing?
Thanks,
Anthony
IIS doesn't allow for downloading of config files, so you either have to ditch it and find another way or turn it on in IIS to allow for that, but be warned that if you do that, other .config files can be downloaded then too, such as web.config in ASP.NET apps, etc.
It's not quite as bad as that. Put the following into a web.config file where the app is located (assuming this is a sub folder of your site). It will allow your config file (I've assumed it's called myapp.exe.config, but change if different) to be downloaded, but no other .config files.
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="GET" path="myapp.exe.config" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
</configuration>
Hope this helps
Mark
Hey Mark, good one. I still find myself forgetting and getting confused between stuff in the config file and IIS and which takes precedence, etc...thanx for the config code.