all groups > visual studio .net debugging > august 2005 >
You're in the

visual studio .net debugging

group:

How to set breakpoints in the generated code for VS Beta2 TableAda



How to set breakpoints in the generated code for VS Beta2 TableAda Tom Allen
8/12/2005 4:58:44 PM
visual studio .net debugging: I set set breakpoints in the code that is generated for a TableAdapter in VS
Beta 2, but the debuger never stops at them. I locate the generated source
files by browsing into the dataset through the Class View. Is there a
better way? What might be going wrong? Thanks!

RE: How to set breakpoints in the generated code for VS Beta2 TableAda v-garych NO[at]SPAM online.microsoft.com (
8/15/2005 8:17:18 AM
Hi Tom,

[quoted text, click to view]


If I set a breakpoint in my custom TableAdapter's constructor function, the
program will stop at that point as expected.

So which line of the generated code of your TableAdapter do you set the
breakpoint at, would you please illustrate the detailed repro steps for us,
we need to repro the problem in our local environment for test...


Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
RE: How to set breakpoints in the generated code for VS Beta2 Tabl Tom Allen
8/16/2005 9:08:01 AM
Hi Gary,

Thank you for the reply.

Here are the steps to reproduce the problem using the Northwind database.

Create a connection to Northwind database
Add a Dataset named TestDataSet to project. The DataSet Wizard runs
select Northwind connection
use SQL statements commands
use Query Builder to select Category table columns CategoryID,
CategoryName, Description
Select options to generate Fill, GetData and Update methods
Wizard creates DataTable named Categories and TableAdapter named
CategoriesTableAdapter
Save TestDataSet. This generates adapter code.

In the ClassView browser navigate to TestDataSetTableAdapters |
CategoriesTableAdapter
Double-click on method GetData, set a breakpoint at the method entry point
and at the code line for Me.Adapter.Fill(dataTable)
Select the New method of CategoriesTableAdapter and set a breakpoint at
MyBase.New

On design surface double-click on ObjectDataSource1 to create method
ObjectDataSource1_Selecting
Add code "Dim i As Integer = 1"
Set a breakpoint at this line.

Add a blank WebForm named Test.aspx to the project
In design mode for Test.Aspx drag an ObjectDataSource from the toolbox to
the surface -- the instance is named ObjectDataSource1
Right click on ObjectDataSource1 and select Configure Data Source
Choose business object TestDataSetTableAdapters.CategoriesTableAdapter
Choose method GetData and Finish the wizard.

Drag a GridView to the design surface of Test.aspx
Set the DataSource to ObjectDataSource1
Save the page

Compile the solution
Press F5 to run app in debugger
The debugger displays test.aspx.vb and stops at line "Dim i As Integer = 1".
Press F5 to continue.
The page appears with data -- pretty cool, actually, but...

NOTE that the debugger does not stop at the New, GetData, or Fill methods in
the CategoriesTableAdapter.
When I browse to the source for CategoriesTableAdapter via the Class View
the breakpoint dots are open circles, not solid, and hovering over them gives
the message "At testdataset.xsd.72cecc2a.vb line 515... The breakpoint will
not currently be hit. The specified module has not been loaded."

In my test the source file containing CategoriesTableAdapter is named
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET
Files\qtrax_proto_1\f54d4011\21c74200\Sources_App_Code\testdataset.xsd.72cecc2a.vb

So, how do I find the source file that *is* loaded?

Thanks much for your help.

+tom allen


RE: How to set breakpoints in the generated code for VS Beta2 Tabl stcheng NO[at]SPAM online.microsoft.com
8/17/2005 10:25:40 AM
Hi Tom,

I think the difference you met between the winform and webform application
is a normal behavior due to the differernt compilation model for ASP.NET
2.0. In asp.net 2.0, the component code are put in App_Code folder which is
dynamically compiled. That means the dataset's code you view in IDE is just
partial class's portion , not complete. The complete code (or refer as the
final code source for the actual executing DataSet instance) are dynamic
generated from this and is put under the ASP.NET temporary folder. That's
why the source in your IDE's project won't take effect when you debugging
the APP.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: How to set breakpoints in the generated code for VS Beta2
Tabl
| thread-index: AcWifK0xeFAMPYiZS1SYnvW3yvIbtg==
| X-WBNR-Posting-Host: 156.153.255.195
| From: =?Utf-8?B?VG9tIEFsbGVu?= <TomAllen@discussions.microsoft.com>
| References: <ECDD6612-6A51-464E-832E-7E6DE0029E81@microsoft.com>
<xKxHHHXoFHA.940@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: How to set breakpoints in the generated code for VS Beta2
Tabl
| Date: Tue, 16 Aug 2005 09:08:01 -0700
| Lines: 65
| Message-ID: <EB5A3B31-16D4-4EEE-B769-183006544A7A@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.vsnet.debugging
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.vsnet.debugging:2626
| X-Tomcat-NG: microsoft.public.vsnet.debugging
|
| Hi Gary,
|
| Thank you for the reply.
|
| Here are the steps to reproduce the problem using the Northwind database.
|
| Create a connection to Northwind database
| Add a Dataset named TestDataSet to project. The DataSet Wizard runs
| select Northwind connection
| use SQL statements commands
| use Query Builder to select Category table columns CategoryID,
| CategoryName, Description
| Select options to generate Fill, GetData and Update methods
| Wizard creates DataTable named Categories and TableAdapter named
| CategoriesTableAdapter
| Save TestDataSet. This generates adapter code.
|
| In the ClassView browser navigate to TestDataSetTableAdapters |
| CategoriesTableAdapter
| Double-click on method GetData, set a breakpoint at the method entry
point
| and at the code line for Me.Adapter.Fill(dataTable)
| Select the New method of CategoriesTableAdapter and set a breakpoint at
| MyBase.New
|
| On design surface double-click on ObjectDataSource1 to create method
| ObjectDataSource1_Selecting
| Add code "Dim i As Integer = 1"
| Set a breakpoint at this line.
|
| Add a blank WebForm named Test.aspx to the project
| In design mode for Test.Aspx drag an ObjectDataSource from the toolbox to
| the surface -- the instance is named ObjectDataSource1
| Right click on ObjectDataSource1 and select Configure Data Source
| Choose business object TestDataSetTableAdapters.CategoriesTableAdapter
| Choose method GetData and Finish the wizard.
|
| Drag a GridView to the design surface of Test.aspx
| Set the DataSource to ObjectDataSource1
| Save the page
|
| Compile the solution
| Press F5 to run app in debugger
| The debugger displays test.aspx.vb and stops at line "Dim i As Integer =
1".
| Press F5 to continue.
| The page appears with data -- pretty cool, actually, but...
|
| NOTE that the debugger does not stop at the New, GetData, or Fill methods
in
| the CategoriesTableAdapter.
| When I browse to the source for CategoriesTableAdapter via the Class View
| the breakpoint dots are open circles, not solid, and hovering over them
gives
| the message "At testdataset.xsd.72cecc2a.vb line 515... The breakpoint
will
| not currently be hit. The specified module has not been loaded."
|
| In my test the source file containing CategoriesTableAdapter is named
| C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET
|
Files\qtrax_proto_1\f54d4011\21c74200\Sources_App_Code\testdataset.xsd.72cec
c2a.vb
|
| So, how do I find the source file that *is* loaded?
|
| Thanks much for your help.
|
| +tom allen
|
|
|
|
RE: How to set breakpoints in the generated code for VS Beta2 Tabl Tom Allen
8/17/2005 1:50:04 PM
Thank you vrey much for your reply, Steven. Does this mean that we can't
debug Web applications? There is an awful lot of functionality in the
TableAdapter code and it is very unfortunate not to be able to see what's
going on.

Perhaps there a set of steps where I can attach the debugger to the asp.net
worker process and find where the consolidated source file is?

Thanks again,

RE: How to set breakpoints in the generated code for VS Beta2 Tabl stcheng NO[at]SPAM online.microsoft.com
8/18/2005 9:22:39 AM
Thanks for your followup.

I think such problem won't occur for normal component classes we put in
App_Code that'll be compiled. For example, we define a normal helper class
and put the code file in App_Code, I think the source can be debug into
correctly. The problem is somewhat due to the particular compile model for
the dataset. In addition, since the orginal bin dir still avaialbe for put
existing precompiled component, we can put Typed DataSEt components in a
separate class library project and put the compiled assembly in "bin" dir,
I think this can help us use the model that normal .ne app use rather than
let the asp.net runtime dynamic compile it.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: How to set breakpoints in the generated code for VS Beta2
Tabl
| thread-index: AcWjbT5KIrJVKZKwQ5+Gzdoae/qbXg==
| X-WBNR-Posting-Host: 156.153.254.42
| From: =?Utf-8?B?VG9tIEFsbGVu?= <TomAllen@discussions.microsoft.com>
| References: <ECDD6612-6A51-464E-832E-7E6DE0029E81@microsoft.com>
<xKxHHHXoFHA.940@TK2MSFTNGXA01.phx.gbl>
<EB5A3B31-16D4-4EEE-B769-183006544A7A@microsoft.com>
<KVX9CYxoFHA.3120@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: How to set breakpoints in the generated code for VS Beta2
Tabl
| Date: Wed, 17 Aug 2005 13:50:04 -0700
| Lines: 11
| Message-ID: <FC1EF89A-8941-43D1-99C2-BCE26FD0CBF9@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.vsnet.debugging
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.vsnet.debugging:2632
| X-Tomcat-NG: microsoft.public.vsnet.debugging
|
| Thank you vrey much for your reply, Steven. Does this mean that we can't
| debug Web applications? There is an awful lot of functionality in the
| TableAdapter code and it is very unfortunate not to be able to see what's
| going on.
|
| Perhaps there a set of steps where I can attach the debugger to the
asp.net
| worker process and find where the consolidated source file is?
|
| Thanks again,
|
| +tom
|
RE: How to set breakpoints in the generated code for VS Beta2 Tabl Tom Allen
8/18/2005 12:53:03 PM
Steven,

That worked for me -- thanks for the suggestion.

I created a separate project for my Data Access Layer and created my
DataSets there. I compiled this project and added a reference to it from the
the Business Logic project. Now the debugger stops at breakpoints set in the
TableAdapter code.

Thanks again,
RE: How to set breakpoints in the generated code for VS Beta2 Tabl v-garych NO[at]SPAM online.microsoft.com (
8/19/2005 12:00:00 AM
Great Tom, we are delight to our suggestion works for you:)

Good Luck!


Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button