Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > .EXE.CONFIG for an IIS deployed EXE
 

.EXE.CONFIG for an IIS deployed EXE

I'm trying to get an application to run from the address bar.  

The application is running fine, it's just failing when it attempts to read the .exe.config file which contains some vital settings for the app.

The exception I'm getting is a WebException with the error "The remote server returned an error: (403) Forbidden."

From log information I can see that it is attempting to load the .exe.config file I believe IIS is refusing the request, returning an error.

I suspect the issue here is that .config's are not something thats normally read....  most ASP.Net people would probably regard it as a pretty major security flaw if it could be.

Before I go and create a work around.... turn my .config into a xml and parse it manually...

Is there some trick here ?

Has anyone found a way to get a .exe.config file processed normally when the applicaiton is deployed from IIS ?

MigrationUser 1  Sunday, February 23, 2003 8:21 PM
I came across an article that might help... the url is:

http://www.ondotnet.com/lpt/a/3154

The title is "Distributed .config Files with Smart Clients", by Chris Sells.
MigrationUser 1  Monday, February 24, 2003 8:31 AM
Yep, there is a solution for your problem....

It's so simple, and i lost so much time trying to solve it....

THe problem is that IIS simply refuses access to .config files, no matter if the are web.config or exe.config.

The solution is to remove this behaviour from the folder where your application exe is.

Go to IIS, and get properties of the folder your application is, then u must probably have it configured as an application if not click on the button Create, make sure execute permissions are Scripts only. then click on the button configure and on the mappings search for .config and click on remove.


This will allow your .config file to be allowed read access.....


Leandro Teixeira
MigrationUser 1  Monday, February 24, 2003 9:14 AM
Even simpler, no mapping removals required.  just create a web.config in the folder where your exe and config file are located (assuming this is a sub folder of your site).  It will allow your config file ONLY to be downloaded (i.e. no other .config files). I've assumed your config file is called myapp.exe.config but change as required.

<?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

MigrationUser 1  Tuesday, March 25, 2003 7:29 AM

You can use google to search for other answers

Custom Search

More Threads

• Cannot create shortcut in Visual Studio 2005 setup project
• ClickOnce Samples and Questions
• How do I pass and retreive command line arguments
• Deployment of .net framework
• Error while connecting to a cube
• Referencing install directory on a registry value
• CONDITION: Looking to Simply Include a File Based on Configuration Type
• Driver Pre-Installation problem
• RadioButon dialog and updating the xml file
• error establishing a connection to my database