I have a client/server application using the .Net 2.0 Framework. I'm using Visual Studio 2008 to build and manage code.
When I run either a Debug or Release version of the application simply by starting the .exe, I get an insert statement on the database that tries to insert a "0" for the foreign key of a table, triggering an error because the primary key of the other table is not 0.
When I run the application by hitting the play buttton ("Start Debugging"), the insert statement uses the correct foreign key.
In the first case, this happens even when I "Attach to Process" to the Debug version after it's started.
My question: what's the difference between attaching to the debug version of the application after it has started and starting the application from the debugger?