Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2003, 02:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default machine.config

Hello,

I can't get my ASP.NET application to read some appSettings from the machine.config file. I can get my VB.NET application to read it, but not ASP.NET.

More specifically, I have a class library that has an app.config file in it with the connection string in that file. I have other information in the machine.config file that I am retrieving. When I test the class library, it retrieves the information via the app.config file. However, when I use the class libary in the ASP.NET account, first off it uses the web.config file instead of the app.config file, and second it doesn't get any information from the machine.config file.

Any ideas what is happening?

Thanks,

Brian Mains
__________________
Brian
 
Old December 1st, 2003, 02:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I should also say that the class library and ASP.NET applications are in separate projects, and the ASP.NET project makes a reference to the class library. I don't know if this makes a difference or not.

Thanks,

Brian Mains
 
Old December 1st, 2003, 02:35 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Both a windows forms application and a web forms application should get info out of machine.config. If it doesn't then maybe there's a problem with the .net setup on your machine.

Windows forms applications get use app.config, but it's turned into <myApplicationName>.config when you compile it. However, web forms applications use web.config and it stays as it is.

Are you sure that you are dealing with the right machine.config? Do you have 2 versions of the framework running? Could you be changing the wrong one?

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 1st, 2003, 04:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I modified the machine.config under <Windows>\Microsoft.NET\Framework\... config folder for the most recent version. There were two version folders, but the older version didn't have a machine.config (am only running one version). That's the only machine.config file that I'm aware of. Is there another one?
 
Old December 1st, 2003, 05:00 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

No, that is it. Only one. I was thinking maybe you had the wrong version. You shouldn't need to do anything other than change the machine.config file. ASP.net will reset/restart correctly when that file changes. If something you put in there isn't working, I can't imagine what it could be. Triple check your syntax although incorrect syntax should cause something to fault.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Config error--machine.config sunithavasudevan ASP.NET 1.0 and 1.1 Professional 2 October 10th, 2006 07:14 AM
machine.config Mike McClanahan BOOK: ASP.NET Website Programming Problem-Design-Solution 9 September 8th, 2004 07:18 AM
machine.config [email protected] BOOK: ASP.NET Website Programming Problem-Design-Solution 7 August 24th, 2004 07:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.