473,394 Members | 2,052 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,394 software developers and data experts.

Problem with Environment.MachineName

Ely
When I call the Environment.Machinename to try to get the local machines
name, I get a "Object reference not set to an instance of an object" error.
This same code works fine on my local machine, it just started having
problems when i rolled it out to a production machine.

Thanks
Nov 18 '05 #1
2 2780
Hi,

Maybe your ASP.NET account doesn't have permission to read environment
variables. Refer to:
http://msdn.microsoft.com/library/de.../en-us/cpref/h
tml/frlrfsystemenvironmentclassmachinenametopic.asp

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
Ely
This was from a windows service, not asp.net.

However, I did find the answer to my problem. The computer had netbios
disabled. Once I re-enabled netbios, the command worked fine.

Thanks for the response.
"Natty Gur" <na***@dao2com.com> wrote in message
news:ug****************@TK2MSFTNGP09.phx.gbl...
Hi,

Maybe your ASP.NET account doesn't have permission to read environment
variables. Refer to:
http://msdn.microsoft.com/library/de.../en-us/cpref/h
tml/frlrfsystemenvironmentclassmachinenametopic.asp

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3

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

Similar topics

0
by: Jacob Colding | last post by:
Hello, I have created a a logging mechanism, that writes mesages to a custom event log. On each check it verifies whether the requested source is registered to the "IPS" log. If not, it changes...
0
by: duncsss | last post by:
Hi, I'm using the following code to get the Machine name in an app System.Environment.MachineName On most computers this works fine but on one of our testers computers (machine is a windows...
0
by: Paul Duncan | last post by:
Hi, I'm using the following code to get the Machine name in an app System.Environment.MachineName On most computers this works fine but on one of our testers computers (machine is a windows...
1
by: Simon Johnson | last post by:
I'm having trouble creating a custom event log. Here's my Code: static void Main(string args) { if (!EventLog.SourceExists("OnlineTonnages")) EventLog.CreateEventSource("OnlineTonnages","EWC...
10
by: Edward | last post by:
I've just taken over maintaining a system from a colleague who has left. I find the following line in her code: Dim params(2) As SqlClient.SqlParameter params(0) = New...
2
by: tmoffett | last post by:
I am very new to the language so please pardon my ignorance. I am writing a small console application to gather hardware inventory information. When I run the application locally all works well....
0
by: Ben | last post by:
I modified the logmonitor sdk example so it would work over a network. It works great when the client and server are running on the same PC and have administrator privileges. So I have two...
2
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I am having a bit of a nightmare with the following: if(!Directory.Exists(folderPath)) Directory.CreateDirectory(folderPath); When I add a watch to this while debugging I see that the...
3
by: J | last post by:
The following code finds the existing file when run in the development environment, but not when deployed (in IIS on the same box). Why? String myFile = @"J:\My_jpgs\The Den\jvc90-03.JPG";...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.