This topic is locked

Editing web.config and save it forever

10/16/2017 11:08:06 AM
ASPRunner.NET General questions
C
ccvvccc author

Hi all,
I would like to edit web.config in output directory and save it. My aim is to keep my changes on web.config even if I build and upload my project to FTP.
At the moment, I am having problem with "maxRequestLength" setting. I would like to add this <httpRuntime maxRequestLength="1048576" /> to web.config and have it always on web.config.

But I cant. I cant see that after I built my project. It just disappears.
I cant upload large files with asprunner.net but if I add that code to web.config, it works. Thats why I want to keep my changes on web.config.
Thanks for any idea.

jadachDevClub member 10/16/2017

I deal with this often myself. I typically do not re-upload the changed web.config file once I get it how I want.

Pete K 10/16/2017



I deal with this often myself. I typically do not re-upload the changed web.config file once I get it how I want.


+1. I use Robocopy with the /MIR and /XF switches to mirror my local output directory to the server and include web.config in the exclude list, e.g.:

robocopy "C:\Users\pkoutoul\Documents\ASPRunnerNETProjects\Blueprint\output" "R:\inetpub\wwwroot\_Virtual_apps\blueprint\1.0" /MIR /XF web.config


It works, but it would still be nice to have a way to create a local partial web.config and have it merge with the stock version upon build.

C
ccvvccc author 10/17/2017

I fixed the problem temporarily. I host my asprunner.net site as an application under a site on IIS.
So my web site is: www.example.com and my asprunner.net app is : www.example.com/cms
asprunner.net app uses my master site's webconfig for maxRequestLength setting. So asprunner.net app's webconfig is still uneditable, but I can edit my master site's webconfig with visual studio. But if I used asprunner.net as a single site on IIS (not as an application on IIS), this method doesnt work.