Friday, July 8, 2011

Debugger doesn't stop at breakpoints in VS 2005 (UPDATE)

Problem:
Ok, forget last solution, I encountered the issue again and apparently am not the only one:
http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/4f7b3eb5-67b5-4066-8299-fe7635cc1d82


Solution:

What finally worked for me was this:
Step 1:
Tools-> Options -> Debugging -> Symbols: Uncheck 'Load Symbols' (see below)


Step 2:
Right click solution --> Common Properties --> Startup Project: Set to 'Mutliple' and 'Start' (see below)






Learning is doing ...
Robert

Monday, June 27, 2011

Debugger doesn't stop at breakpoints in VS 2005

Problem:


Debugger in VS 2005 does not stop at breakpoints.


Solution:


Make sure you have the debug setting in the web.config (http://forums.asp.net/p/1278210/2440003.aspx#2440003)
Ok, I already had the corrects settings, yet still the same problem.
This resolved it:
right-click solution --> configuration. My settings where: configuration:.Net, I changed it to Active .Net.




Learning is doing ...
Robert

Wednesday, October 6, 2010

How to change compile dir in studio


Problem:

When you do a build of a web site in VS, it puts the generated dll's in the \WINDOWS\Microsoft.NET\Framework\[your .net version]\Temporary ASP.NET Files directory. When it's time to deploy you have to search for the generated dll's, annoying.

Wouldn't it be handy to have VS put the dll's where you want them?

Solution:

Create the following section in your web.config:
<compilation debug="true" tempDirectory="c:\yourdir">

Learning is doing ...
Robert

Thursday, May 15, 2008

Project does not have a valid Sub Main

I encountered this error and it didn't make sense to me because I didn't have a Sub Main. Why vb.net gave that message is still a riddle to me. How did I resolve this? First you need to find out to what project the error pertains. Unfortunately double clicking the error does not tell you where the error resides. So select the messages tab and you will find in what project this error occurs.


Once you know what project this occurs, copy the code and paste it temporarily in a text document. Then remove that particular project. Then save all and close the solution. Then look up the physical location of the project that you just deleted and make sure that the directory of the deleted directory does not exist. Now restart your solution and add back your project again. And voila, no more errors.

Monday, May 12, 2008

Stack Frame

When you use many functions and procedures it can be handy to know where run time error occur.
The class StackFrame allows you to query the calling function.

Example:

Private Function SomeFunction() as Boolean

Try
_balance = -100
Catch ex as Exeption
Throw new Exception("Balance cannot be negative. Function: " & ((New StackFrame).GetMethod.Name), ex)
End Try
End Function


Monday, May 5, 2008

Add array to arraylist

I'd like to elaborate a bit more on arraylists. What if you utilize a class that returns an array. Maybe you made a call to a database and it returns you an array. But you want to use the nice stuff..eh. like in the arraylist..!

Well, we can still use the arraylist. In order to use the arraylist we have to add our array to an arraylist. We will use the addRange method. Here is how:

We will use our good old cars array.

dim cars(2) as string
dim listcars as new ArrayList

cars(0) = "ford"
cars(1)= "chevy"

listcars.AddRange(cars)

There you go, we added our cars array to our arrayList listcars. So now we are able to use all the nice methods that listcars exposes.

I don't know yet why Microsoft added the array and arraylist, why not use the arraylist?

happy programming