Very Strange Error

stustarz

Well-known member
Joined
Jan 10, 2003
Messages
246
Location
Earth
Hello

Firstly if i have placed this into the wrong forum i do apologise but I am not sure what this error is referring to:

"An unhandled exception of type System.NullReferenceException occurred in Unknown Module.

Additional information: Object reference not set to an instance of an object."

If i choose Break on the message box it then says:

"There is no source code available for the current location

This error is shown when I try to run the application (press F5 in VB.net).

If i create a brand new project and dont add any controla or anything, then this error will appear. If I add a label and a picture, the error appears, BUT if I try and run a previous project that I know works it doesnt appear - it only seems to happen on my new projects - does anyone know what the error means and how I can solve it. By the way - I havent deleted or added any code whatsoever.

Thanks
 
I have no idea why this would happen, but my first course of action would probably be to uninstall and reinstall visual studio.
 
Just a thought.... It usally happens when the source code and binary are out of sync (via the debugging files)

In your project properties, are you still compiling it automatically, or does it run without being compiled?
 
Hi thanks for the replies - ive uninstalled and re-installed and that hasnt changed anything, for the other reply im not really sure what you mean.

I have looked on MSDN and apparently its caused when im trying to unreference an unavailable reference but surely if I havent even added any code to a project this wouldnt occur

Any more help would be greatly appreciated
 
Sorry man... now that I read my own reply, I can see it not that clear.. :)

If you go to your solution properties page (right click on solution and click on Properties) and click on Configuration Properties, you will see a grid. Make sure that the Column (Build) is ticked for all your projects.
If its not ticked, the project isnt compiled automatically by vs, and you dll and source will be out of sync.

Hope its more clear now...
Cheers
 
Thanks for the response - unfortunately no luck im afraid. At the moment i cannot create any new applications. Anyone else got any ideas.
 
Well, first youll have to uninstall and reinstall VStudio a few more times and then install more RAM, get a faster processor and upgrate to the latest version of Windows.

Just kidding!

I actually ran into this same exact problem, and the solution was closer to what cywizz had to say.

Go into the solution properties again, and make sure the value in the "Configuration" column is set to "Debug". Then recompile your project and try again.

Additionally, Im just talking about the "There is no source code available for the current location" error, not the NullReferenceException. But if you are able to debug your project after this fix, you should be able to fix the problem.

Oh yeah, and make sure your Machine Debug Manager Service isnt disabled or anything.
 
Back
Top