|
 |
aspx thread: Debugging - how can I get decent info?
Message #1 by marl@s... on Wed, 19 Feb 2003 00:16:05
|
|
Hi:
I'm trying to debug my app. I'm compiling all the .cs files into one dll.
I've got debug="true" in the @Page tag.
It's not returning a page name, line or barely enough to see what's wrong.
What I'd really like to see is the sql statement that went haywire.
Is any of this possible or am I stuck with:
[SqlException: Incorrect syntax near the keyword 'Where'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
(CommandBehavior behavior) +9
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
+36
StockWatcher.swMain.SetStocks() +2310
StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +724
Message #2 by "Mike Amundsen" <mike@a...> on Tue, 18 Feb 2003 20:56:49 -0500
|
|
Couple things might help.
If you are using VS.NET, be sure you compile in debug mode so the system
will store the line numbers and other data in a separate file (*.pdb).
If
you are using command line compiling, then you need to include the debug
option on the command line to generate this data. This is especially
important if your ASPX pages are calling into DLLs. The debugging info
is
limited in the DLL unless you use the debug compile option.
Next, if you are running the app locally, you'll probably find the
step-by-step debugger pretty handy. You can set a breakpoint at any line
and
step through the code to find the line that is breaking. While this is
super simple in VS.NET, it's also quite possible without VS.Net. Using
the
stand-alone GUI debugger that comes with the Framework SDK takes a bit
of
set up, but not much and you get almost all the same info, too.
Also, even the example you show here has lots of info. For example, the
method SetStocks is making a db call with a bad SQL statement.
Debuggers
might tell you the line at which the SQL statement is *called* but they
won't tell you what's wrong with the query itself.
Finally, esp. for ASP.NET apps, I use the trace=3D"true" setting in the
page
directive quite a bit. You can see lots of info like query strings, form
values, cookies, etc. with almost no effort. And you can even write code
like this to have the trace tool output values at runtime for you to
see:
Trace.Write("SQL Statement=3D" & SQLstring,"MyVars")
Hope this helps.
MCA
> -----Original Message-----
> From: marl@s... [mailto:marl@s...]
> Sent: Wednesday, February 19, 2003 12:16 AM
> To: ASP.NET
> Subject: [aspx] Debugging - how can I get decent info?
>
> Hi:
>
> I'm trying to debug my app. I'm compiling all the .cs files into one
dll.
>
> I've got debug=3D"true" in the @Page tag.
>
> It's not returning a page name, line or barely enough to see what's
wrong.
> What I'd really like to see is the sql statement that went haywire.
>
> Is any of this possible or am I stuck with:
>
> [SqlException: Incorrect syntax near the keyword 'Where'.]
> System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
>
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
> (CommandBehavior behavior) +9
> System.Data.Common.DbDataAdapter.Fill(Object data, Int32
startRecord,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> behavior) +121
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior) +77
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
> +36
> StockWatcher.swMain.SetStocks() +2310
> StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
> System.Web.UI.Control.OnLoad(EventArgs e) +67
> System.Web.UI.Control.LoadRecursive() +29
> System.Web.UI.Page.ProcessRequestMain() +724
Message #3 by "Alex Smotritsky" <alex.smotritsky@v...> on Tue, 18 Feb 2003 20:54:04 -0500
|
|
Your not using vs.net so this won't apply but I'll say it anyway, if you
can get asp.net/sql debugging to work in vs.net(which I can't) then you
can step directly from asp.net front end code into stored procedures on
sql server. This can be awesome for debugging, I know because in vs.net
I've stepped from server side vbscript to sql server stored procedures
to find errors.
-----Original Message-----
From: marl@s... [mailto:marl@s...]
Sent: Wednesday, February 19, 2003 12:16 AM
To: ASP.NET
Subject: [aspx] Debugging - how can I get decent info?
Hi:
I'm trying to debug my app. I'm compiling all the .cs files into one
dll.
I've got debug="true" in the @Page tag.
It's not returning a page name, line or barely enough to see what's
wrong. What I'd really like to see is the sql statement that went
haywire.
Is any of this possible or am I stuck with:
[SqlException: Incorrect syntax near the keyword 'Where'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
(CommandBehavior behavior) +9
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
+36
StockWatcher.swMain.SetStocks() +2310
StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +724
Message #4 by marl@s... on Wed, 19 Feb 2003 14:58:59
|
|
Arg! It looks like I'm eventually gonna have to break down and get the
MSDN Universal again. Debuging everything including sp's from one
interface would be pretty nice.
Thanks
> Your not using vs.net so this won't apply but I'll say it anyway, if you
can get asp.net/sql debugging to work in vs.net(which I can't) then you
can step directly from asp.net front end code into stored procedures on
sql server. This can be awesome for debugging, I know because in vs.net
I've stepped from server side vbscript to sql server stored procedures
to find errors.
-----Original Message-----
From: marl@s... [mailto:marl@s...]
Sent: Wednesday, February 19, 2003 12:16 AM
To: ASP.NET
Subject: [aspx] Debugging - how can I get decent info?
Hi:
I'm trying to debug my app. I'm compiling all the .cs files into one
dll.
I've got debug="true" in the @Page tag.
It's not returning a page name, line or barely enough to see what's
wrong. What I'd really like to see is the sql statement that went
haywire.
Is any of this possible or am I stuck with:
[SqlException: Incorrect syntax near the keyword 'Where'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
(CommandBehavior behavior) +9
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
+36
StockWatcher.swMain.SetStocks() +2310
StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +724
Message #5 by marl@s... on Wed, 19 Feb 2003 15:08:35
|
|
This helps a lot. Being able to see the sql statement w/out working to
hard at it is probably most important for me. I knew it was a problem w/
the sql statement but didn't know what the problem was. I had to poke and
hope. I finally did fix it but it took some doing.
Thanks much. I'll try these suggestions.
> Couple things might help.
If you are using VS.NET, be sure you compile in debug mode so the system
will store the line numbers and other data in a separate file (*.pdb).
If
you are using command line compiling, then you need to include the debug
option on the command line to generate this data. This is especially
important if your ASPX pages are calling into DLLs. The debugging info
is
limited in the DLL unless you use the debug compile option.
Next, if you are running the app locally, you'll probably find the
step-by-step debugger pretty handy. You can set a breakpoint at any line
and
step through the code to find the line that is breaking. While this is
super simple in VS.NET, it's also quite possible without VS.Net. Using
the
stand-alone GUI debugger that comes with the Framework SDK takes a bit
of
set up, but not much and you get almost all the same info, too.
Also, even the example you show here has lots of info. For example, the
method SetStocks is making a db call with a bad SQL statement.
Debuggers
might tell you the line at which the SQL statement is *called* but they
won't tell you what's wrong with the query itself.
Finally, esp. for ASP.NET apps, I use the trace=3D"true" setting in the
page
directive quite a bit. You can see lots of info like query strings, form
values, cookies, etc. with almost no effort. And you can even write code
like this to have the trace tool output values at runtime for you to
see:
Trace.Write("SQL Statement=3D" & SQLstring,"MyVars")
Hope this helps.
MCA
> -----Original Message-----
> From: marl@s... [mailto:marl@s...]
> Sent: Wednesday, February 19, 2003 12:16 AM
> To: ASP.NET
> Subject: [aspx] Debugging - how can I get decent info?
>
> Hi:
>
> I'm trying to debug my app. I'm compiling all the .cs files into one
dll.
>
> I've got debug=3D"true" in the @Page tag.
>
> It's not returning a page name, line or barely enough to see what's
wrong.
> What I'd really like to see is the sql statement that went haywire.
>
> Is any of this possible or am I stuck with:
>
> [SqlException: Incorrect syntax near the keyword 'Where'.]
> System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
>
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
> (CommandBehavior behavior) +9
> System.Data.Common.DbDataAdapter.Fill(Object data, Int32
startRecord,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> behavior) +121
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior) +77
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
> +36
> StockWatcher.swMain.SetStocks() +2310
> StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
> System.Web.UI.Control.OnLoad(EventArgs e) +67
> System.Web.UI.Control.LoadRecursive() +29
> System.Web.UI.Page.ProcessRequestMain() +724
Message #6 by marl@s... on Fri, 21 Feb 2003 21:24:14
|
|
Thanks again Mike:
This helped a *great* deal.
I was able to make the clr debugger work with .exe files but I can't make
it work with aspx. My problem is that it asks for me to select a "program"
which is looking for a file (I presume exclusively an exe file).
How can I make it work aspx applications?
Also, I didn't quite get this: "trace=3D"true"". I tried to complile w/
that in the <@Page tag but it crashed. I can use trace="true" which helped.
> Couple things might help.
If you are using VS.NET, be sure you compile in debug mode so the system
will store the line numbers and other data in a separate file (*.pdb).
If
you are using command line compiling, then you need to include the debug
option on the command line to generate this data. This is especially
important if your ASPX pages are calling into DLLs. The debugging info
is
limited in the DLL unless you use the debug compile option.
Next, if you are running the app locally, you'll probably find the
step-by-step debugger pretty handy. You can set a breakpoint at any line
and
step through the code to find the line that is breaking. While this is
super simple in VS.NET, it's also quite possible without VS.Net. Using
the
stand-alone GUI debugger that comes with the Framework SDK takes a bit
of
set up, but not much and you get almost all the same info, too.
Also, even the example you show here has lots of info. For example, the
method SetStocks is making a db call with a bad SQL statement.
Debuggers
might tell you the line at which the SQL statement is *called* but they
won't tell you what's wrong with the query itself.
Finally, esp. for ASP.NET apps, I use the trace=3D"true" setting in the
page
directive quite a bit. You can see lots of info like query strings, form
values, cookies, etc. with almost no effort. And you can even write code
like this to have the trace tool output values at runtime for you to
see:
Trace.Write("SQL Statement=3D" & SQLstring,"MyVars")
Hope this helps.
MCA
> -----Original Message-----
> From: marl@s... [mailto:marl@s...]
> Sent: Wednesday, February 19, 2003 12:16 AM
> To: ASP.NET
> Subject: [aspx] Debugging - how can I get decent info?
>
> Hi:
>
> I'm trying to debug my app. I'm compiling all the .cs files into one
dll.
>
> I've got debug=3D"true" in the @Page tag.
>
> It's not returning a page name, line or barely enough to see what's
wrong.
> What I'd really like to see is the sql statement that went haywire.
>
> Is any of this possible or am I stuck with:
>
> [SqlException: Incorrect syntax near the keyword 'Where'.]
> System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
>
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
> (CommandBehavior behavior) +9
> System.Data.Common.DbDataAdapter.Fill(Object data, Int32
startRecord,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> behavior) +121
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior) +77
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
> +36
> StockWatcher.swMain.SetStocks() +2310
> StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
> System.Web.UI.Control.OnLoad(EventArgs e) +67
> System.Web.UI.Control.LoadRecursive() +29
> System.Web.UI.Page.ProcessRequestMain() +724
Message #7 by "Mike Amundsen" <mike@a...> on Fri, 21 Feb 2003 18:52:11 -0500
|
|
Glad this is helping.
The trace equals true thing is what you want. My previous message was
mangled along the way and the "3D" you see is a hex code injected into
the
message when you received it.
Ok, on the clr guidebugger (which I like to use a lot for aspx)...
What you need to do to get this working for ASPX is kinda 'hacky', but
makes
sense. The clr debugger is looking for a program to jump into. Since
ASPX
pages are not really the programs, you need to 'attach' to something
else
instead. What you attach to is the running process that is your ASPX
page
up and running already.
Since it takes a bit of explaining, I posted a long-ish tutorial on my
web
site here:
http://EraBlog.NET/filters/9274.post
hope this helps.
MCA
> -----Original Message-----
> From: marl@s... [mailto:marl@s...]
> Sent: Friday, February 21, 2003 9:24 PM
> To: ASP.NET
> Subject: [aspx] RE: Debugging - how can I get decent info?
>
> Thanks again Mike:
> This helped a *great* deal.
> I was able to make the clr debugger work with .exe files but I can't
make
> it work with aspx. My problem is that it asks for me to select a
"program"
> which is looking for a file (I presume exclusively an exe file).
> How can I make it work aspx applications?
>
> Also, I didn't quite get this: "trace=3D3D"true"". I tried to complile
w/
> that in the <@Page tag but it crashed. I can use trace=3D"true" which
> helped.
>
> > Couple things might help.
>
> If you are using VS.NET, be sure you compile in debug mode so the
system
> will store the line numbers and other data in a separate file (*.pdb).
=3D
> If
> you are using command line compiling, then you need to include the
debug
> option on the command line to generate this data. This is especially
> important if your ASPX pages are calling into DLLs. The debugging
info =3D
> is
> limited in the DLL unless you use the debug compile option.
>
> Next, if you are running the app locally, you'll probably find the
> step-by-step debugger pretty handy. You can set a breakpoint at any
line =3D
> and
> step through the code to find the line that is breaking. While this
is
> super simple in VS.NET, it's also quite possible without VS.Net.
Using =3D
> the
> stand-alone GUI debugger that comes with the Framework SDK takes a bit
=3D
> of
> set up, but not much and you get almost all the same info, too.
>
> Also, even the example you show here has lots of info. For example,
the
> method SetStocks is making a db call with a bad SQL statement. =3D
> Debuggers
> might tell you the line at which the SQL statement is *called* but
they
> won't tell you what's wrong with the query itself.
>
> Finally, esp. for ASP.NET apps, I use the trace=3D3D"true" setting in
the =3D
> page
> directive quite a bit. You can see lots of info like query strings,
form
> values, cookies, etc. with almost no effort. And you can even write
code
> like this to have the trace tool output values at runtime for you to
=3D
> see:
>
> Trace.Write("SQL Statement=3D3D" & SQLstring,"MyVars")
>
> Hope this helps.
>
> MCA
>
> > -----Original Message-----
> > From: marl@s... [mailto:marl@s...]
> > Sent: Wednesday, February 19, 2003 12:16 AM
> > To: ASP.NET
> > Subject: [aspx] Debugging - how can I get decent info?
> >=3D20
> > Hi:
> >=3D20
> > I'm trying to debug my app. I'm compiling all the .cs files into one
=3D
> dll.
> >=3D20
> > I've got debug=3D3D"true" in the @Page tag.
> >=3D20
> > It's not returning a page name, line or barely enough to see what's
=3D
> wrong.
> > What I'd really like to see is the sql statement that went haywire.
> >=3D20
> > Is any of this possible or am I stuck with:
> >=3D20
> > [SqlException: Incorrect syntax near the keyword 'Where'.]
> > System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> > cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
> > =3D
> System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
> > (CommandBehavior behavior) +9
> > System.Data.Common.DbDataAdapter.Fill(Object data, Int32 =3D
> startRecord,
> > Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior
> > behavior) +121
> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> > startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> > CommandBehavior behavior) +77
> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String =3D
> srcTable)
> > +36
> > StockWatcher.swMain.SetStocks() +2310
> > StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
> > System.Web.UI.Control.OnLoad(EventArgs e) +67
> > System.Web.UI.Control.LoadRecursive() +29
> > System.Web.UI.Page.ProcessRequestMain() +724
>
Message #8 by marl@s... on Sat, 22 Feb 2003 18:09:35
|
|
I just looked at your tutorial on your site.
It was quite detailed and easy to read.
Thanks very much.
I had one small problem. I learned that you have to check:
"Show System Processes" to make the aspnet_wp.exe show up.
It worked for me. I could step through the code.
If I tried to do anything else in the ASPX app though it crashed.
That wasn't a big deal.
Again, thanks very much.
> Glad this is helping.
The trace equals true thing is what you want. My previous message was
mangled along the way and the "3D" you see is a hex code injected into
the
message when you received it.
Ok, on the clr guidebugger (which I like to use a lot for aspx)...
What you need to do to get this working for ASPX is kinda 'hacky', but
makes
sense. The clr debugger is looking for a program to jump into. Since
ASPX
pages are not really the programs, you need to 'attach' to something
else
instead. What you attach to is the running process that is your ASPX
page
up and running already.
Since it takes a bit of explaining, I posted a long-ish tutorial on my
web
site here:
http://EraBlog.NET/filters/9274.post
hope this helps.
MCA
> -----Original Message-----
> From: marl@s... [mailto:marl@s...]
> Sent: Friday, February 21, 2003 9:24 PM
> To: ASP.NET
> Subject: [aspx] RE: Debugging - how can I get decent info?
>
> Thanks again Mike:
> This helped a *great* deal.
> I was able to make the clr debugger work with .exe files but I can't
make
> it work with aspx. My problem is that it asks for me to select a
"program"
> which is looking for a file (I presume exclusively an exe file).
> How can I make it work aspx applications?
>
> Also, I didn't quite get this: "trace=3D3D"true"". I tried to complile
w/
> that in the <@Page tag but it crashed. I can use trace=3D"true" which
> helped.
>
> > Couple things might help.
>
> If you are using VS.NET, be sure you compile in debug mode so the
system
> will store the line numbers and other data in a separate file (*.pdb).
=3D
> If
> you are using command line compiling, then you need to include the
debug
> option on the command line to generate this data. This is especially
> important if your ASPX pages are calling into DLLs. The debugging
info =3D
> is
> limited in the DLL unless you use the debug compile option.
>
> Next, if you are running the app locally, you'll probably find the
> step-by-step debugger pretty handy. You can set a breakpoint at any
line =3D
> and
> step through the code to find the line that is breaking. While this
is
> super simple in VS.NET, it's also quite possible without VS.Net.
Using =3D
> the
> stand-alone GUI debugger that comes with the Framework SDK takes a bit
=3D
> of
> set up, but not much and you get almost all the same info, too.
>
> Also, even the example you show here has lots of info. For example,
the
> method SetStocks is making a db call with a bad SQL statement. =3D
> Debuggers
> might tell you the line at which the SQL statement is *called* but
they
> won't tell you what's wrong with the query itself.
>
> Finally, esp. for ASP.NET apps, I use the trace=3D3D"true" setting in
the =3D
> page
> directive quite a bit. You can see lots of info like query strings,
form
> values, cookies, etc. with almost no effort. And you can even write
code
> like this to have the trace tool output values at runtime for you to
=3D
> see:
>
> Trace.Write("SQL Statement=3D3D" & SQLstring,"MyVars")
>
> Hope this helps.
>
> MCA
>
> > -----Original Message-----
> > From: marl@s... [mailto:marl@s...]
> > Sent: Wednesday, February 19, 2003 12:16 AM
> > To: ASP.NET
> > Subject: [aspx] Debugging - how can I get decent info?
> >=3D20
> > Hi:
> >=3D20
> > I'm trying to debug my app. I'm compiling all the .cs files into one
=3D
> dll.
> >=3D20
> > I've got debug=3D3D"true" in the @Page tag.
> >=3D20
> > It's not returning a page name, line or barely enough to see what's
=3D
> wrong.
> > What I'd really like to see is the sql statement that went haywire.
> >=3D20
> > Is any of this possible or am I stuck with:
> >=3D20
> > [SqlException: Incorrect syntax near the keyword 'Where'.]
> > System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> > cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
> > =3D
> System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
> > (CommandBehavior behavior) +9
> > System.Data.Common.DbDataAdapter.Fill(Object data, Int32 =3D
> startRecord,
> > Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior
> > behavior) +121
> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> > startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> > CommandBehavior behavior) +77
> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String =3D
> srcTable)
> > +36
> > StockWatcher.swMain.SetStocks() +2310
> > StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
> > System.Web.UI.Control.OnLoad(EventArgs e) +67
> > System.Web.UI.Control.LoadRecursive() +29
> > System.Web.UI.Page.ProcessRequestMain() +724
>
Message #9 by "Mike Amundsen" <mike@a...> on Sat, 22 Feb 2003 13:12:35 -0500
|
|
Hmmm
Didn't think about that "show system processes" must have it turned on
all
the time in my setup. I'll update the tutorial.
About the crash for you. Not sure what you mean there. Is something not
working with the debugging or is this something in your app itself?
Also, did you know you can use trace=3D"true"? and you can also use
Trace.Write and Trace.Warn in your code to output values to the trace
logs.
MCA
> -----Original Message-----
> From: marl@s... [mailto:marl@s...]
> Sent: Saturday, February 22, 2003 6:10 PM
> To: ASP.NET
> Subject: [aspx] RE: Debugging - how can I get decent info?
>
> I just looked at your tutorial on your site.
> It was quite detailed and easy to read.
> Thanks very much.
>
> I had one small problem. I learned that you have to check:
> "Show System Processes" to make the aspnet_wp.exe show up.
>
> It worked for me. I could step through the code.
> If I tried to do anything else in the ASPX app though it crashed.
> That wasn't a big deal.
>
> Again, thanks very much.
>
> > Glad this is helping.
>
> The trace equals true thing is what you want. My previous message was
> mangled along the way and the "3D" you see is a hex code injected into
=3D
> the
> message when you received it.
>
> Ok, on the clr guidebugger (which I like to use a lot for aspx)...
> What you need to do to get this working for ASPX is kinda 'hacky', but
=3D
> makes
> sense. The clr debugger is looking for a program to jump into. Since
=3D
> ASPX
> pages are not really the programs, you need to 'attach' to something
=3D
> else
> instead. What you attach to is the running process that is your ASPX
=3D
> page
> up and running already.
>
> Since it takes a bit of explaining, I posted a long-ish tutorial on my
=3D
> web
> site here:
> http://EraBlog.NET/filters/9274.post
>
> hope this helps.
>
> MCA
>
> > -----Original Message-----
> > From: marl@s... [mailto:marl@s...]
> > Sent: Friday, February 21, 2003 9:24 PM
> > To: ASP.NET
> > Subject: [aspx] RE: Debugging - how can I get decent info?
> >=3D20
> > Thanks again Mike:
> > This helped a *great* deal.
> > I was able to make the clr debugger work with .exe files but I can't
=3D
> make
> > it work with aspx. My problem is that it asks for me to select a =3D
> "program"
> > which is looking for a file (I presume exclusively an exe file).
> > How can I make it work aspx applications?
> >=3D20
> > Also, I didn't quite get this: "trace=3D3D3D"true"". I tried to
complile =3D
> w/
> > that in the <@Page tag but it crashed. I can use trace=3D3D"true"
which
> > helped.
> >=3D20
> > > Couple things might help.
> >=3D20
> > If you are using VS.NET, be sure you compile in debug mode so the
=3D
> system
> > will store the line numbers and other data in a separate file
(*.pdb). =3D
> =3D3D
> > If
> > you are using command line compiling, then you need to include the
=3D
> debug
> > option on the command line to generate this data. This is especially
> > important if your ASPX pages are calling into DLLs. The debugging
=3D
> info =3D3D
> > is
> > limited in the DLL unless you use the debug compile option.
> >=3D20
> > Next, if you are running the app locally, you'll probably find the
> > step-by-step debugger pretty handy. You can set a breakpoint at any
=3D
> line =3D3D
> > and
> > step through the code to find the line that is breaking. While this
=3D
> is
> > super simple in VS.NET, it's also quite possible without VS.Net.
=3D
> Using =3D3D
> > the
> > stand-alone GUI debugger that comes with the Framework SDK takes a
bit =3D
> =3D3D
> > of
> > set up, but not much and you get almost all the same info, too.
> >=3D20
> > Also, even the example you show here has lots of info. For example,
=3D
> the
> > method SetStocks is making a db call with a bad SQL statement.
=3D3D
> > Debuggers
> > might tell you the line at which the SQL statement is *called* but
=3D
> they
> > won't tell you what's wrong with the query itself.
> >=3D20
> > Finally, esp. for ASP.NET apps, I use the trace=3D3D3D"true" setting
in =3D
> the =3D3D
> > page
> > directive quite a bit. You can see lots of info like query strings,
=3D
> form
> > values, cookies, etc. with almost no effort. And you can even write
=3D
> code
> > like this to have the trace tool output values at runtime for you to
=3D
> =3D3D
> > see:
> >=3D20
> > Trace.Write("SQL Statement=3D3D3D" & SQLstring,"MyVars")
> >=3D20
> > Hope this helps.
> >=3D20
> > MCA
> >=3D20
> > > -----Original Message-----
> > > From: marl@s... [mailto:marl@s...]
> > > Sent: Wednesday, February 19, 2003 12:16 AM
> > > To: ASP.NET
> > > Subject: [aspx] Debugging - how can I get decent info?
> > >=3D3D20
> > > Hi:
> > >=3D3D20
> > > I'm trying to debug my app. I'm compiling all the .cs files into
one =3D
> =3D3D
> > dll.
> > >=3D3D20
> > > I've got debug=3D3D3D"true" in the @Page tag.
> > >=3D3D20
> > > It's not returning a page name, line or barely enough to see
what's =3D
> =3D3D
> > wrong.
> > > What I'd really like to see is the sql statement that went
haywire.
> > >=3D3D20
> > > Is any of this possible or am I stuck with:
> > >=3D3D20
> > > [SqlException: Incorrect syntax near the keyword 'Where'.]
> > > System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> > > cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
> > > =3D3D
> >
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader
> > > (CommandBehavior behavior) +9
> > > System.Data.Common.DbDataAdapter.Fill(Object data, Int32 =3D3D
> > startRecord,
> > > Int32 maxRecords, String srcTable, IDbCommand command, =3D
> CommandBehavior
> > > behavior) +121
> > > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> > > startRecord, Int32 maxRecords, String srcTable, IDbCommand
command,
> > > CommandBehavior behavior) +77
> > > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
=3D3D
> > srcTable)
> > > +36
> > > StockWatcher.swMain.SetStocks() +2310
> > > StockWatcher.swMain.Page_Load(Object sender, EventArgs e) +878
> > > System.Web.UI.Control.OnLoad(EventArgs e) +67
> > > System.Web.UI.Control.LoadRecursive() +29
> > > System.Web.UI.Page.ProcessRequestMain() +724
> >=3D20
>
|
|
 |