Usually when I get an exception, the code line that creates it is marked yellow etc.. However now i only get a System.NullReferenceException as a line in the Immidiate window;
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
Is this due to some setting, or why don't I get any better indication?
I use Visual Studio 2003, VB.net, NetFramework 1.4 and Windows XP I have been using the following Code Snippet for a number of years in both Web Services and Windows Applications. However suddenly around the 29th September 2010 it has stopped sending E-Mails from both Web Services and Windows Applications. The same problem has happened not only to my own Network but on two other Networks, one using XP as its Server and the other using Server 2003. All 3 of these are using different ISPs.
I'm trying to get my head around this issue, on a few of my functions i get a warning " 'functionDealWithHiddenFields' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used."Example function:
vb.net Function functionDealWithHiddenFields(ByVal HTML As String, ByVal numHiddenFields As Integer, ByVal X As Integer)
i have a simple code that send an e-mail, when i try it running in debug mode it works fine, after compile, i run the exe but the same code doesn't work any more..
i get a warning " 'functionDealWithHiddenFields' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used."
Example function:
vb.net Function functionDealWithHiddenFields(ByVal HTML As String, ByVal numHiddenFields As Integer, ByVal X As Integer) Try
[code]....
The functions still work correctly (as far as i can tell) what would i need to do to the above function to remedy that warning?
Private Sub BugReportsCentral_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser2.Navigate("http://xxxxxxxxxxx.net/update/link/on-off/threadreport.html")
[code]...
Why this code doesn't work? It doesn't print the label with the correct thing.
I have got some code that is working as i have edited the game.exe at a certain address, now i know the code can find the address, but I don't know how to make it stop searching for it if it isn't there.
here is the:
code:
So what I want to know, is how to stop this code, if the address doesn't exist.
the error code points to a Stack-Overflow I can not pin the offending code down because the software works faultlessly on some computers after deployment but on others the crash occurs when a Gantt chart gets redrawn after changing activity dates. All the computers are situated on the same LAN and connect to the same SQL server 2008 database.The application has been developed with Visual Studio 2008.
I used the same install disk on all the computers and they are all using the same date/time format. The crashes occur on both 32 - and 64 bit machines.
The error message: Stopped working Problem signature: Problem Event Name: APPCRASH Application Name: Pfisterer Project Manager.exe
So I have a program that I am converting to .NET FW 3.5 and I am getting the titled exception on the following line:If IsNothing(dsTopPI.Rows.Find(profile.Item("GEMSID"))) Then Continue For
which is in a for each loop. The thing is, I have set the primary key and when I put in the following code:Dim columns() = DSTop30Profiles1.DTtop30profiles.PrimaryKey Console.WriteLine("Column count: " & columns.Length.ToString)For a = 0 To columns.GetUpperBound(0)Console.WriteLine(columns(a).ColumnName & " - " & columns(a).DataType.ToString)Next
I get this in the output:Column count: 1 GEMSID - System.Int32
That would seem to indicate that there is in fact a primary key, right?
Note: this is not a duplicate of Jeff's question. That question asked "Is an equivalent?" I know there isn't, and I want to know why! The reason I ask is that I've only just become clear on how important it is, and the conclusion seems very strange to me. The Exception Handling block of Microsoft's Enterprise Library advises us to use this pattern:
[Code]...
The policy is defined in an XML file, so that means that if a customer has an issue, we can modify the policy to assist with tracking down (or perhaps papering over) the problem to give them a fast resolution until we deal with it properly - which may involve arguing with 3rd parties, about whose fault it all is. This is basically an acknowledgement of the simple fact that in real applications the number of exception types and their "recoverability" status is practically impossible to manage without a facility like this.
Meanwhile, the CLR team at MS says this is not an option, and it turns out those guys know what they're talking about! The problem is that right before the catch block runs, any finally blocks nested inside the try block will be executed. So those finally blocks may do any of the following: Harmlessly modify the program state (phew, lucky). Trash something important in the customer's data, because the program state is screwed up to an unknown degree. Disguise or destroy important evidence that we need to diagnose an issue - especially if we're talking about calls into native code. Throw another exception, adding to the general confusion and misery.
Note that the using statement and C++/CLI destructors are built on try/finally, so they're affected too. So clearly the catch/throw pattern for filtering exceptions is no good. What is actually needed is a way to filter exceptions, via a policy, without actually catching them and so triggering the execution of finally blocks, unless we find a policy that tells us the exception is safe to recover from. The CLR team blogged about this recently:
To programming and have a question with sound files. I am trying to figure out the basics and here is what I did: I created a button that is supposed to play a sound.
My.Computer.Audio.Play("C:.......file.wav")
When I click this button in my .exe file it obviously plays because I am using the computer with the above location for the .wav file. When I use the .exe on another computer it doesn't play because it does not recognize that .wav location. How do I make this work for me? Do I need to embed the .wav with my .exe somehow?
I have creating timekeeping application, I was used drag and drop for my datagridview. During build I can add, edit and delete records. But when I published and run there was an error saying (see below). [Code] When JIT debugging is enabled, any unhandled exception, will be sent to the JIT debugger registered on the computer, rather than be handled by this dialog box.
I was using this old method of creating a bunch of rectangles when I need to get the location of a certain point within a grid so I could draw images on the grid. The thing is, I don't want to use rectangles, I want to be able to just round the location as if I were using rectangles. I need it to be able to round the point (66,70) to (50,50) so if you can imagine a grid and the mouse position being within that square in the grid, I need to get the location of the upper left corner of that square.
I have an ASP.Net form where I use a DropDownList control to display data retrieved from a table. However setting the SelectedValue of the DropDownList to a value not existing in the dropdown list does not trigger an exception.
What is going on with my code. To .NET and handling SQL connections. I am trying to catch an error where lets say someone puts in something that violates the rules of the field (i.e. they put data in a field that doesn't matched what is on the other table.) Please find teh code I ahve put on the save button to try to catch the error. Instead of popping a message box up the program just closes itself.
Private Sub Job_tableBindingNavigatorSaveItem_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Job_tableBindingNavigatorSaveItem.Click Try
im trying to get mac adddress from this code but i get eerror on END FUNCTION line it says this "function 'getRemoteMac' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used." what am i missing here?
In my project, I have a local dataset (XSD) that I am using as local-temporary tables. I am getting a System.InvalidCastException when trying to access the field in one the tables. I believe this is because I my code is (incorrectly) not setting a field's value in a row before trying to access it.My problem is that the exception is breaking in the designer file and not in my code. As a result, I'm having difficulting determining which line of my code reading the field value before it has been set. Is there any way to configure Visual Studio to break in my code instead of in the designer created file?
on my program i have an activation in it and in order to activate the program you need to enter a code that is stored in the settings. so i was looking through my computer and i found the programs config file. and so I opened it and i found all of the codes for the activation. I need to find out how to make the file so the user doesn't have access to it and then how to move it to a more hidden place in the C: drive.
Im in need of somehow a code that with a picturebox, depending on WHERE you click it will do something. Lets say theres a picture of a face. The eyes are at like x = 12, y = 28 , if the user clicks the picturebox around that area a msgbox will come up saying "Eye" or something, this is just an example
<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 TransitionalEN"> <html> <head>
The problem that I am having is the randomization. Obviously, the game wouldn't be very fun if the cards where in the same position every time. For this reason, I want the cards to be in a random position every time the game runs. I'm using buttons as the cards, so I guess, put simply, I want to be able to have the cards have a different location, out of 12 preset locations each time.
I have a WinForms app in a single project written in VB.Net 2003 (legacy code). There is a MainForm and a SecondaryForm that is run by the MainForm. When I run the app thru the MainForm, I can debug with no problem. However, if I just run the SecondaryForm, I get the debug error, "There is no source code available for the current location", when stepping over,_routeId = CInt(myVar)
At this point I am no longer able to debug thru my code window, but have to use the disassembled code.
when i run the application it gives an error "there is no source code available for the current location". Even i try to debug using f8 and msgbox in all forms,It doesn go thru it.I dont know what goes wrong with my application.All the while it goes perfectly alright.what does this error message meant and why all the way in sudden it happens to be like this?
I have a VB.Net project that I haven't worked on in awhile. I got into this morning and started to run it. I got some errors so I decided to step thru the code. I enter the Page_Load event of a Form module and execute a function call and it takes me to a "End Function" statement. Totally bypasses the function that was called. I continued to step thru it and it just took me randomly thru code. No order whatsoever. I believe I've had this happen before but don't recall how I fixed it.
It is possible to catch an exception and throw a new exception which wraps the first exception as an inner exception: [URL] Also, if I call a function and it throws a certain error, but I catch it, will the calling code's catch handler execute? If so, and it is of a higher exception type, is this not wrapping the exception? eg I can throw exception ex of type IndexOutOfRange, log it but rethrow, catch a higher up exception and do something, or I can throw a new exception and wrap an inner exception like:
I recently completed my first book and am looking for a project to create. I want something simple that has a bunch of different features in it. Can anyone recommend a good project? I am going to try tic-tac-toe.
How do you set a location from source code? I tried : button.Location.X = button.Location.X + 10
I'm inexperienced with windows forms (vb.net), and I have a rather silly question.I'm opening an old project of someone elses, and there's a PictureBox control on the form. The PictureBox has a photo, and I'm trying to find the location of the photo on the computer but can't find it.In ASPX, I can just look at the code behind and find out where the tags are pointing to (for the photo).The only code that exists for my object, with the image property is this: [code]
I'm attempting to create an app which uses a vendor-supplied Web Service. They provided sample code to show how to work with the Web Service, but all the code is in C#.. not a huge deal.I opened one of their demo projects and it compiles fine, works perfectly.
So, I open up MY project, drop in the converted code and... wait for it... ERROR!Here is the working C# code that IS working:
C# private void DoSomethingWithTheAlarm(G4T.enAlarmAction action) { XML_AlarmClearRequest[] ClearRequest = new XML_AlarmClearRequest[lstAlarms.SelectedItems.Count]; int idx = 0; foreach (ListViewItem lvItem in lstAlarms.SelectedItems) { ClearRequest[idx] = new XML_AlarmClearRequest();
I have made some changes in my code but when i do debug it doesn't show the changes.For example: In my code i create a simple text file in "C" drive.I have change the path to the desktop and when i do debug it still create it in the "C" drive.