473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Modify AppSettings during Install

Hi All,
Is there a way to modify AppSettings key values during installation of a web
app using a web setup project.

Thanks in advance.
Neelima
Nov 18 '05 #1
2 3041
Yes, through a custom installer. Unfortunately, I do not know of any great
source for the information on building a custom installer component. You
basically grab the file, as XML, prior to deploying. If you run this after
the install, the file gets locked.

Another option is to incorporate the Configuration Management Application
Block (free download, full source) from MSDN:

download =
http://www.microsoft.com/downloads/d...displaylang=en

info =
http://msdn.microsoft.com/library/en.../cmab.asp?_r=1
With custom configuration, you create additional config files that can be
set at any time (a way around the web.config lock from application code). In
addition, you can add the DPAPI (data protection API) to encrypt the
information; the DPAPI is already coded into the Block, so you basically
tell it to encrypt and it encrypts. Very easy to use once you get used to
it.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Neelima Godugu" <gn******@HOTMAIL.COM> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi All,
Is there a way to modify AppSettings key values during installation of a web app using a web setup project.

Thanks in advance.
Neelima

Nov 18 '05 #2
There's no automatic way to do this. You can copy a Web.config of course,
but customizing it is not directly supported.

You can do this with a custom action from you install, but what I prefer to
do is have the application start and automatically run a configuration page
the first time it runs. The app can even do this by checkign for some
setting in the configuration. if not found you can redirect to the config
page.

On the other hand this requires that the ASP.Net app can write to the
directory or at least web.config.

+++ Rick ---
--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/articles.asp
-------------------------------------
Making waves on the Web
"Neelima Godugu" <gn******@HOTMAIL.COM> wrote in message
news:#g*************@TK2MSFTNGP10.phx.gbl...
Hi All,
Is there a way to modify AppSettings key values during installation of a web app using a web setup project.

Thanks in advance.
Neelima

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Hartmann | last post by:
How do I influence the platform type during install? Could you look at this and tell me what I'm doing wrong? It's still using information from get_platform instead of using my preference. #...
3
by: DC Gringo | last post by:
Hi, I'm trying to use a custom action to modify a database (rather than create one) using the VS.NET '03's help example called "Custom Action to Create Database During Installation". I've made...
3
by: Chad Smith | last post by:
Hi, I have created a .NET deployment project in Visual Studio 2003. I have specified an entry point into my own code in this installer which launches into the familiar: public override void...
5
by: Alberto | last post by:
I need to modify a value in the app.config file with this code: System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); string key =...
4
by: Jim in Arizona | last post by:
I've been using VB 2005 for a few years now. My entire coding history is VB related. This weekend I decided to start learning C#. I'm at work now and decided to do some coding in C# that I would...
1
by: =?Utf-8?B?TGV2ZW50IERhZ2lzdGFubGk=?= | last post by:
I think you are running your code from VS. Just run the exe from outside and it will work. Thanks, Levent Dagistanli "Andrew" wrote:
6
by: Nick | last post by:
Hi there, I have a Windows Service application that has a load of settings defined, I can access these using My.Settings. I would like to pass the NameValueCollection of the settings to...
1
by: =?Utf-8?B?THVib21pcg==?= | last post by:
Hi, I have a custom settings in <appSettingssection in the web.config. I need to modify this section from the C# exe application (NOT asp.net) web.config: <appSettings> <add key="MyKeyName"...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all I have an app.config file for my App, and use MailSettings Section. I can modify AppSettings and ConnectionsStrings , and then save app.config.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.