Groups | Blog | Home
all groups > dotnet performance > may 2005 >

dotnet performance : httpcontext.current.application["tag"] VS Configuration.Appsetting


sahridhayan
5/20/2005 6:18:05 AM
hi all

i just want to know which approach is the best..

i frequently access some variable informations..

i have virtualdirectory (hosted remoting in IIS) i have appsettings.. keys
and values

which approach is the best in accessing the key and values..

System.web.httpcontext.current.application["tag"]

or
System.Configuration.Appsettings["tag"]..

because i frequently access the information stored in the values..
(web.config)

all your directions will be of much helpful..

regs
sahridhayan



Robbe Morris [C# MVP]
5/21/2005 7:32:25 PM
I would use System.Configuration.Appsettings["tag"]..
because it is applicable inside a class for both web
applications and windows applications. At some point,
you may need to use your business logic for the web
app on the desktop.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net



[quoted text, click to view]

sahridhayan
5/23/2005 6:55:09 AM
thanks robbe for your pointer..

would there be performance difference?

I am not able to use httpcontext. it does not fetch tags....returning null..

I am also forced to use system.configuration.appsettings...
eventhough we dont have any support or use for winforms applications.. as of
now



regs
sahridhayan


[quoted text, click to view]
Robbe Morris [C# MVP]
5/24/2005 8:54:31 PM
Performance difference is minimal if any.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net



[quoted text, click to view]

AddThis Social Bookmark Button