473,804 Members | 3,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best way for app to determine what server it is on and customize config info?

I would like to be able to move my ASP.NET applications to any of a number
of servers without changing code.

My apps do a lot of disk I/O and in some cases I might be specifying absoute
drive mappings for whatever bad reason. This will break if apps are
arbitrarily copied around.

I imagine I could centralize a bunch of configurations in web.config. If my
apps could reliably (and efficiently) identify what server they were running
off of, they could pick out the right settings for a particular server. This
need extends beyond the rather trivial example of drive mappings.

Can someone suggest a good way or ways?

Thanks,
-KF

Aug 23 '07 #1
3 1513
Hi Ken,

From your description, you have developed an ASP.NET web application and
since your application will have many disk I/O accessing operations in the
application(whi ch seriouly coupled with the machine's physical disk, path
structure), you're wondering a flexible way to make your application avoid
changing when deploy over different servers, correct?

Based on my experience, for ASP.NET application(or other .net
applications) that will deal with some machine specific (or changable)
things, it is a good practice to store those changable info in application
configuration file. Thus, we can modify and customize the configuration
file whenever deploy to a new server box.

For your scenario, you mentioned that

=============
If my apps could reliably (and efficiently) identify what server they were
running off of, they could pick out the right settings for a particular
server.
=============

would you give some further explanation on this? Do you mean you need to
programmtically get the current machine's name or you want the server
configuratino info of the current machine? .NET's built-in class
"System.Environ ment" has provide some static members give us some data of
the current machine(such as MachineName and SpecialFolders. ..). For other
machine specific info, you may use WMI interface to query some certain info
you want.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.



Aug 24 '07 #2
Thanks, this was exactly what I was looking for, Steven. All I need is some
simple key for what machine is what, and System.Environm ent will tell me
that. Appreciate it.

-KF
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:MF******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Ken,

From your description, you have developed an ASP.NET web application and
since your application will have many disk I/O accessing operations in the
application(whi ch seriouly coupled with the machine's physical disk, path
structure), you're wondering a flexible way to make your application avoid
changing when deploy over different servers, correct?

Based on my experience, for ASP.NET application(or other .net
applications) that will deal with some machine specific (or changable)
things, it is a good practice to store those changable info in application
configuration file. Thus, we can modify and customize the configuration
file whenever deploy to a new server box.

For your scenario, you mentioned that

=============
If my apps could reliably (and efficiently) identify what server they were
running off of, they could pick out the right settings for a particular
server.
=============

would you give some further explanation on this? Do you mean you need to
programmtically get the current machine's name or you want the server
configuratino info of the current machine? .NET's built-in class
"System.Environ ment" has provide some static members give us some data of
the current machine(such as MachineName and SpecialFolders. ..). For other
machine specific info, you may use WMI interface to query some certain
info
you want.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.


Aug 24 '07 #3
My pleasure :)

Regards,

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Aug 27 '07 #4

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

Similar topics

2
1615
by: Marty McDonald | last post by:
Many of our apps are in production and they do not have proper error logging in them - unhandled errors are seen by the users in the form of error messages and stack traces. I know how to make apps handle their errors (global.asax.cs "application_error" event, web.config "customErrors" section, etc). But can I do this without having to visit each app? Can this be done at the machine level? I'm looking for a kind of machine-level...
1
1253
by: Stelios Skiathitis | last post by:
In ASP.NET I want to create a form for authenticating a user to enter in a local intranet site. I want the user to have the option of selecting two different authentication modes. The first using windows authentication form where the user will be authenticated through his current login username. (in that case the user won't have to enter any usr/pwd info at the corresponding form fields) The second using database authentication where the...
3
1722
by: SMG | last post by:
Hi All, From where I can customize 404 error. I.e. the error is printed below.. Server Error in '/sharekhan' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its
7
1385
by: Brian Henry | last post by:
I've never stored a program specific connection string in the web.config file before, is there any information on how to store it there and access it from the app and what would be the best way to handle a string like this in asp.net 2.0? thanks!
6
2884
by: sameer | last post by:
..NET Framework 1.1 VS2003 Application is making webservice calls from behind a proxy server and then freezes and dies. Questoin is can i use webservice over proxy server( i guess another name of them is ISA ... if i a not wrong), if yes how? Sameer
7
7002
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form is correct I need to submit to another page that uses the form data. I first tried making the form submit action= field point to the same file. When the form was correct, I tried loading the next page by using <META http-equiv refresh>. But...
7
5082
by: DC | last post by:
Hi, there is a 500;13 page one can configure in the website properties, but ..Net Framework 1.1 also delivers the "server too busy" message sometimes and the IIS custom error page does not seem to catch that. How would I customize the error page then? Regards DC
7
10830
by: =?Utf-8?B?TW9iaWxlTWFu?= | last post by:
Hello everyone: I am looking for everyone's thoughts on moving large amounts (actually, not very large, but large enough that I'm throwing exceptions using the default configurations). We're doing a proof-of-concept on WCF whereby we have a Windows form client and a Server. Our server is a middle-tier that interfaces with our SQL 05 database server.
7
3585
by: Steve | last post by:
I am building an object library for tables in a database. What is the best practice for creating objects like this? For example, say I have the following tables in my database: User: - Id - FirstName - LastName - CompanyId (many-to-one )
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.