|
Actually, that would throw a TypeLoadException since the types are not the same, but you apparently handled the exception and continued executing code, meaning that the object you were trying to instantiate of that type was still null , hence the NullReferenceException .
You can avoid this problem in your multi-project solution by adding project reference instead of assembly reference. So, if project "B" depends on project "A", right-click on project "B", select Add Reference, then click the Projects tab. Double-click project "A" to add it.
Now a build dependency is established. Any changes to project "A" will cause project "A" to be compiled when you compiled project "B", and if project "A" is recompile project "B" will grab the new copy when it's compiled. This also means that when you compile a release build of project "B", a release build is compiled for project "A", thus keeping your builds in sync as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
Has anyone developed a custom metadata editor using C#.net or vb.net. if yes, i have a question.
I am trying to develop a custom metadata editor using C#.net. i am using ArcGis 8.3 and Visual studio .net 2003.
when i am trying to execute my custom metadata editor in ArcCatalog it says "Object reference not set to an instance of an object". i don't know where i am going wrong..
I appreciate your help in this regard..
example is given on http://arcobjectsonline.esri.com
Thanks,
Abhi
|
|
|
|
|
If you have a question about a specific product, you should ask on their site (forums, contact emails, etc.). This is not specific to C#, nor should it be expected of this community to support a commercial or non-commercial product; we probably have never even used it.
This is what company/organization support sites are for.
Based on the exception, though, all I can tell you is that your not setting an instance to something, which should be evident from the error.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
Has anyone developed a custom metadata editor using C#.net or vb.net. if yes, i have a question.
I am trying to develop a custom metadata editor using C#.net. i am using ArcGis 8.3 and Visual studio .net 2003.
when i am trying to execute my custom metadata editor in ArcCatalog it says "Object reference not set to an instance of an object". i don't where i am going wrong..
I appreciate your help in this regard..
Thanks,
Abhi
|
|
|
|
|
I would like to convert this string:
1075912849
into this format
02/04/04 08:40:49
|
|
|
|
|
Gee, thanks for all the information and for asking nicely!
What is that number? If it's the number of milliseconds or ticks, from what epoch does it start? Whether it's UTC or not has no bearing, so long as you treat it as UTC.
If you read the documentation for the DateTime struct in the .NET Framework SDK, you'll see that the DateTime struct has an epoch of 1/1/0001 00:00:00. Without knowing the epoch of that number, it's impossible to help you, other than tell you to read about the well-documented DateTime and it's members, such as Parse and it's constructor, which takes a number as a long which represents the ticks (100 ns) since the epoch I mentioned.
If you need help, please provide more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
how can i get my datagrid to reset itself so as the mouseup events keeps firing in my cell? i appreciate the mouse up event is on my datagrid but i would like it to fire every time?
|
|
|
|
|
Declare a state variable and set/reset it when you need. Use a timer if you have to.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Looking for a Cotrol, wich implements the TextFolding just like the Visual C#-Editor
THX
|
|
|
|
|
There is a open source project--"SharpDevelop", it may be helpful to you.
|
|
|
|
|
Hello people, I have an Web Application and I need to get the Mac Address from client computer for security reasons. So I tried to do this by using Windows Control, but Windows Control isn't working when I call for System.Management objects like when I try to get the Mac Address. Explorer shows an alert about SecurityException. Anyone knows how to do this? another solution?
tks
Wender Oliveira
.NET Developer
|
|
|
|
|
You're trying to get the MAC address of a client on the server side of your ASP.NET application. The short answer is, you can't. Not because of the security restrictions either. Simply because when you try and do an ARP resolve on the IP address, you'll get the MAC address of the NIC on the side of the router that the server is on, not the client machine. There is no method of getting the MAC address of a NIC unless that NIC happens to be on the same physical subnet as the server.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Im creating a basic port scanning program that using multi threads to scan ports to serve as a way for me to learn Sockets and Threadpooling, but when i build the program and try to scan one port i get an exception error.
System.Net.Sockets.SocketException: The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for
at System.Net.Dns.GetHostByName(String hostName)
at System.Net.Dns.Resolve(String hostName)
at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
at PortScanner.frmportscanner.scanport(String host, Int32 port) in d:\csharp\ircbot\windowsapplication1\port scanner.cs:line 258
Any Suggestions?
|
|
|
|
|
Try using nslookup.exe in the command-prompt for the name you're trying to connect to and see what you get. The exception message indicates that the necessary data (perhaps an IPv4 address?) wasn't found.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I get that exception for every address i type in.
|
|
|
|
|
I have written a service that grabs the files in a source directory on a remote server and ftp's to local directory. The service monitors the source directory of the server and collects the files as they come in. The Problem: Sometimes the files are physically present but the service recognizes and at the time of transfer it cannot get handle on them. I gut feeling is - the service tries to grab the file when it is in the process of being tranferred to the source directory. It loses the handle on the file and can never recover thereafter. Any suggestions !
Thanks / Vinayak
|
|
|
|
|
The service should maintain a list of files it has tried to copy. If the copy is successful the file can be removed from the list, if not an attempt can be made on the next cycle when it looks for files again.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Thanks Colin.
I have an ftp component that returns the list of files in the source directory as a dataset. But once the file is failed to be tranferred via the Service Component - I go for the next one tranfer it.
When the service makes the next attempt - is gets the failed file
in the list but fails to transfer saying that "the file can not be found".
|
|
|
|
|
japanreddy wrote:
but fails to transfer saying that "the file can not be found".
Is the file physically there? Or in the first failed attempt did it remove the file? (Do you remove the files once they are transferred? If yes, could this be happening even if the file fails to transfer?)
Another, possible workaround is to build in a wait step before transferring the file. You see the new file for the first time, but you wait until the next cycle of the service before attempting to transfer it. As your FTP component returns the list of files as datasets, you could retain the previous dataset and compare it with the new dataset and transfer files that appear on both. BTW, how often do you check the directory for new files?
However, it would be better to find out why the files are failing to transfer and why on the second attempt the file is not found.
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Yes, the file is physically there, yet - the service cannot transfer it!
It did not remove the file on the first attempt. However, if the transfer
is successful, I am removing the file from the remote server.
Your next point is a valid one, that is about removing the file despite its failure to tranfer. I have blocked the code in two try blocks.
In the first try block I try to tranfer the file and remove only if
it is successful. Else do not enter the remove block.
I liked your approach to the problem. Thanks / Vinayak
|
|
|
|
|
Can someone share some Interop C# Code on how to check a word document for Linked OLE Document (typically PPT) and then change it's OLELink Path to a new local directory?
Thank you in advance.
|
|
|
|
|
i need the user to select a value from a datagrid and put that values into a textbox?
|
|
|
|
|
Even handling the WM_PARENTNOTIFY message won't work (it will receive the WM_LBUTTONDOWN message, but you can just as easily handle DataGrid.CurrentCellChanged ) because once the cell is in edit more, the hosted control is what is handling windows messages.
My recommendation is to just handle the DataGrid.CurrentCellChanged with a little logic to determine when the user is picking a cell (or may no additional logic is required).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
yes it is a feature that i think many people have been asking for. the problem is i need the change to be immediate and the cellchanged is one step too late. I settled for the mouse down event it works a treat to increment the value in a textbox i am now working on an event to decrease the value and hopefully trap the right mouse button and use that to decrease the value. growing in confidence by the day!!!
|
|
|
|
|
fell flat on that idea it only fires the once help!!!
|
|
|
|