App.config to Web.config

I have been running a console app, to process a paypal payment.  The code gets a value from the app.config file. 

<add key="PAYFLOW_HOST" value="payflowpro.paypal.com" />

However I have now incorporate the code into a web application and put the key into my web.config file, will the code now know to look for this key in this place?

0
adamargyle
6/5/2008 11:04:21 AM
asp.net.getting-started 91979 articles. 3 followers. Follow

3 Replies
843 Views

Similar Articles

[PageSpeed] 53

If your code is getting the value from your config file using ConfigurationManager.AppSettings["PAYFLOW_HOST"] then it should use the correct config file automatically.  Console apps, windows services and windows form application use app.config, web apps use web.config by default.


-- Please Mark Posts that helped you as Answers, and share a summary of what solved the problem.
0
griff_1000
6/5/2008 11:47:35 AM

Hi There,

You can have appsetting in web.config,

</configSections>

<appSettings>

<add key="PAYFLOW_HOST" value="payflowpro.paypal.com" />

</appSettings>

<system.web>

Example:

To use the config:

string s = ConfigurationManager.AppSettings["PAYFLOW_HOST"];

Hope it helps!

 


DC517
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
0
d4dennis
6/5/2008 11:49:18 AM

Please see following code: 

<appSettings>
<
add key="PAYFLOW_HOST" value="payflowpro.paypal.com" />
</
appSettings>


Now use in cs page:
string val = ConfigurationManager.AppSettings["PAYFLOW_HOST"];


Mark as Answer if this reply is useful to you


Pradeep Kamlapuri
B.Tech (Computer Science & Engineering)
India
0
kamlapuri
6/5/2008 11:57:04 AM
Reply:

Similar Artilces:

How do I merge web services' app.config with web app's web.config? Help!!
I have a web application project that uses a separate class library containing web service references (service layer). I want to be able to configure the web reference URLs dynamically and I know you can set this up by setting the URL behavior to  'Dynamic', etc, etc. The problem is VS2005 puts the URLs in the project's app.config file. When the class library becomes a DLL component, I have no way of accessing the app.config file.Is there a way to make the web reference project to look for the URLs in the web.config instead of its app.config? Or is there a way to merge this app.config w...

Need to put this in a web.config file. Transfer a collection from app.config to web.config.
<!--<setting name="Groups" serializeAs="Xml"> <value> <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <string>GL CA Corporate Data</string> <string>GL CONT Contractors</string> <string>GL IT SolutionDelivery</string> </ArrayOfString> </value> </setting>-->   I need to put this in the below web.config.<?xml version="1.0"?><!-- Note: As an alternative to hand editing this fi...

Read info from web.config, machine.config, app.config....
I know how to read info from the web.config, see code:  Protected path As String = "/Framework" Protected config As Configuration = WebConfigurationManager.OpenWebConfiguration(path) How can I read also the data from machine.config and other config files, like the app.configs?Johan TheunissenMCPD, MCSE, MCTS BizTalk 2006==============================Please mark the most helpful reply/replies as "Answer". ...

App.config/web.config
Hello!! I'm development a web application in n-tiers. The UI have a web.config, and the other tiers using app.config. The problem is that the application doesn´t recognize the app.config files. Only the web.config of the UI. For example: I try to put the connections string in a app.config in the data access, but when it runing, throws a error that says: "Database undefined". But when I put the connections strings in the web.config, it runing well. I need help!!!Alvaro HdezDeveloper To use xml atributes from WebConfig and AppConfig u must add referance to System...

App.Config/Web.Config
I have setup custom config sections. I need to know how to loop through a configuration group and get all of the config sections in that group. Thanks could you post an example of what you have Trey Exactly, your question is not clear at all. Regards.Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP...

.NET 2.0 encryption web.config/app.config options?
Situation: 13 servers containing both ASP .Net web sites and .NET apps. Servers are broken up in Developemnt, Test, and Production types.Issue: Need to encrypt all app.config and web.config files.Currently we are using .NET 1.1, so I had developed (test working, not yet deployed) a shared (GAC) utility that would be responsible for providing an interface to allow the encryption (DPAPI + Second Entropy) of information for the developer to manually place in each web.conf/app.config file during development. The backend of this utility was referenced by the *.config files in decrypting values on...

web.config vs app.config
So, I'm building a composite control that has 3 web references I dynamically set in the Settings/app.config file.  What I'm looking for is a way to allow the consuming developer to edit the URLs in design-time.  However, I can't seem to get to the configuration of my compiled DLL.  Can anyone suggest a way, using code or web.config or whatever, that will allow me to do this?Chris StewartCompiledMonkey.com Anyone?Chris StewartCompiledMonkey.com Look at your generated proxies (from wsdl.exe or WS add web reference feature, which are basically the same). You should be able to...

app.config & web.config
I have a solution file which includes DAL project,BLL and web project. my web application is using web.config for connection string and DAL is using app.config and it makes problem for me when I publish the web site. because every time I wanna to change the connection I have to republish the web site. I was wondering is there any way that app.config or even my datasets in DAL get the connection string from web.config file? I googled it but i didn't find any good soloutions. Thanks.      Friend, you can use the connection string specified in the Web.Config itse...

web.config and app.config in VS2005
Hi thereI'm new to web programming. I'm using asp.net 2.0(vb.net) in Visual Studio 2005. When writing windows applications I use app.config to store string constants. I simply Right click on my project name in Solution Explorer and choose properties. Then I click Settings and type in the name of the constant, type = string, scope = application, the value and I could retrieve it in any form or class of the project using My.Settings.sConstant.How can I do that in web applications using web.config?thanks    Add the following, of course with your own constants: undefinedappSett...

is web.config the equivalent to app.config
is app.config only for winforms,  can a webservice for example have a  app.config http://www.dotnetspider.com/qa/Question21.aspxIf my reply helps answer your question then please mark as answer. web.config is the equivalent. You cannot have an app.config for web forms. Only machine.config and web.config...

app.config and web.config problems
Hi all, I've structured my application in the following way.:1. I've created a library project (.dll) with the BLL and DAL (built using the DataSet VS 2005 designer), at this moment I was asked to put the connection string inside of an app.config file (decrypted).2. In a second project (Web Application) I've put a reference for the .dll mentioned above.3. When I ran the web project for the first time I've got an error indicating that the .dll didn't find the connectionstring used to build the DAL so after some tips I performed a "copy and paste" from app.config...

web.config to app.config issues...
Can I use a custom config section found in a web.config file in a app.config file?Something like this:<configSections> <section name="CS" type="CSSection, __code"/></configSections><CS defaultConnectionStringName="LocalSqlServer"> <Commands providerType="DAL.SqlClient.SqlCommandsProvider" /></CS>I have tried it and .net doesn't seem to like it, producing and error something like this"An error occurred creating the configuration section handler for CS: Could not load file or assembly '__code' or...

running 2 web.configs in the same website 1 in /web.config and one in /swf/web.config
Im having issues doing this. and when i remove the authentication from the swf/web.config it still doesnt seem to be applying to the child website at all. Whats the proper way to set a child website? Thanks!!  The lower most web.config overrides all previous settings. So if you remove the section from the /swf/web.config whatever settings you have in the web.config in the next higher level will have an effect on the content of the child folder.So instead of removing a section, try giving appropriate settings in the /swf/web.config....

how to get the access to modify web.config when running web app?
hi all, I am working on a web app that modification to the web.config may be needed when user logs on as administrator. when user logs on as an administrator, s/he cold choose to change some settings in the web.config. My question is, how to grant the permission of "modify" web.config to this kind of user? I know that all the user access the resources through "anonymouse access", and they use account "XXX\Iuser_XXX" to access the web.config, but this account (or user group) has no access "modify or write" to web.config. When config.save(0 used, the user must have the write perm...

Web resources about - App.config to Web.config - asp.net.getting-started

Proxy auto-config - Wikipedia, the free encyclopedia
Computer operating systems (e.g., Microsoft Windows , Mac OS X , Linux ) require a number of settings to communicate over the Internet . These ...

Platform Updates: New Industry Pages, Refreshed Services Status Page, and New Parse Config Dashboard
Platform Updates: New Industry Pages, Refreshed Services Status Page, and New Parse Config Dashboard

App Config for Android - YouTube
Free version: https://play.google.com/store/apps/details?id=fi.aarosoft.appconfig.free Full version: https://play.google.com/store/apps/deta ...

HP unveils cloud config manager
HP this week unveiled a network virtualization system for large enterprise and cloud providers designed to simplify network configuration.

China configs 'firewall' against official meddling in judicial cases
China configs 'firewall' against official meddling in judicial cases

Apple adds bogus AppleTVs, iPads, iPods and iPhones to another config file, won’t deter developers
Earlier today, Mark Tweeted the amusing new file Apple put in iOS 5.1 beta 2 which includes a lot of silly references to devices that don’t exist. ...

System Software: Configs for Mac 128K, XL, 512, & 512KE (7/94)
Macintosh 128K Currently ships with: Product no longer available. Supports: System 2.0 and Finder 4.1. Recommended: System 2.0 and Finder 4.1. ...

Deals: dozens of new MacBook Air and MacBook Pro Retina configs at lowest prices anywhere
As promised, AppleInsider's Mac Price Guides were expanded over this past week to include 19 configurations of Apple's new MacBook Air (both ...

Dell releases updated XPS-13 Developer Edition in wide variety of configs
... is available immediately in North America and Europe. According to Dell’s announcement blog post , there is a wide variety of possible configurations ...

Config error at Boston-area hosting company takes down Reddit, others
... hosting provider briefly knocked several large services and websites dependent on Amazon and AWS offline on Tuesday night, thanks to a configuration ...

Resources last updated: 11/23/2015 9:51:58 AM