PC Review


Reply
Thread Tools Rate Thread

ASP .NET 2.0 Unanswered questions...

 
 
Scott M.
Guest
Posts: n/a
 
      12th Oct 2007
I've asked this before, but not gotten any clear answers, so I'd figure I'd
try again.

I am an experienced ASP .NET 1.1 developer and I understand the differences
between an ASP .NET 2.0 "Web Site" vs an ASP .NET 2.0 "Web Application"
(among other things, all compiled code placed in several assembly files vs.
one assembly file).

Here are my 2 questions:

ASP .NET 2.0 "Web Application Project"
=============================
In ASP .NET 1.1, when you use a DataAdapter (say with the DataAdapter
Configuration Wizard), you'd be able to see all the wizard's generated code
in the code-behind and perhaps tweak it. In ASP .NET 2.0 Web Application
Project, if I use a TableAdapter and configure it using the designer, I
can't find any code (yes, I know to look in the designer.vb file, rather
than the code-behind) for it.

Where is the code that makes all this new cool ASP .NET stuff work with some
configuration? I know I can't just see the underlying code for the class,
but I want to see the code for the instance. Where is it?!

ASP .NET 2.0 "Web Site"
==================
Where are the compiled assembly files placed? I don't see them anywhere in
my site's directory structure.


No offense, but please only respond if you *know* the answers, not if you
just have suggestions on where I *could* look.

Thanks,

Scott


 
Reply With Quote
 
 
 
 
Chad Scharf
Guest
Posts: n/a
 
      12th Oct 2007
I will attempt to answer your questions here without upsetting you too much
as I'm pretty sure I "know" the answers to your questions:

1, Where's the data adapter code?

In 2.0, in the web application project, XSD designers including data
adapters are considered partial classes. They are also compiled and the code
is generated for them at run-time. Therefore, there is no code to view. If
you want to override a method or property, add attributes, directives or
change the way those adapters work or map outside of the designer, simply
create a new code file in your App_Code directory and define a class (in
your dataset adapters namespace) called the exact same name as the data
adapter and mark it as partial (e.g. public partial class
MyDataTableAdapter), no need for inheritence, this will already be set up
for you, you can however add interfaces if you wish. Then you will notice
when typing "override", you are provided with the virtual methods and
properties from your data adapter and can manipulate the class without
having to "inherit" from it.

2, Where have all the assemblies gone?

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\%app
name%\
and then followed by intertwined assembly directories and cache created by
the runtime, e.g. agentonline\88ab2d2c\588ae2f5\ and then you will find your
assemblies such as App_Browsers.dll, App_Code.dll, App_Web_wu_bfbz-.dll,
etc.

Hope this helps you out.

Regards,
Chad


"Scott M." <s-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've asked this before, but not gotten any clear answers, so I'd figure
> I'd try again.
>
> I am an experienced ASP .NET 1.1 developer and I understand the
> differences between an ASP .NET 2.0 "Web Site" vs an ASP .NET 2.0 "Web
> Application" (among other things, all compiled code placed in several
> assembly files vs. one assembly file).
>
> Here are my 2 questions:
>
> ASP .NET 2.0 "Web Application Project"
> =============================
> In ASP .NET 1.1, when you use a DataAdapter (say with the DataAdapter
> Configuration Wizard), you'd be able to see all the wizard's generated
> code in the code-behind and perhaps tweak it. In ASP .NET 2.0 Web
> Application Project, if I use a TableAdapter and configure it using the
> designer, I can't find any code (yes, I know to look in the designer.vb
> file, rather than the code-behind) for it.
>
> Where is the code that makes all this new cool ASP .NET stuff work with
> some configuration? I know I can't just see the underlying code for the
> class, but I want to see the code for the instance. Where is it?!
>
> ASP .NET 2.0 "Web Site"
> ==================
> Where are the compiled assembly files placed? I don't see them anywhere
> in my site's directory structure.
>
>
> No offense, but please only respond if you *know* the answers, not if you
> just have suggestions on where I *could* look.
>
> Thanks,
>
> Scott
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      12th Oct 2007
It seems to me that by having to generate the code for, say a TableAdapter
at runtime, the application execution would be slowed. Do you mean that
this code is generated at build time and then added to the assembly?

Thanks Chad!



"Chad Scharf" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I will attempt to answer your questions here without upsetting you too much
>as I'm pretty sure I "know" the answers to your questions:
>
> 1, Where's the data adapter code?
>
> In 2.0, in the web application project, XSD designers including data
> adapters are considered partial classes. They are also compiled and the
> code is generated for them at run-time. Therefore, there is no code to
> view. If you want to override a method or property, add attributes,
> directives or change the way those adapters work or map outside of the
> designer, simply create a new code file in your App_Code directory and
> define a class (in your dataset adapters namespace) called the exact same
> name as the data adapter and mark it as partial (e.g. public partial class
> MyDataTableAdapter), no need for inheritence, this will already be set up
> for you, you can however add interfaces if you wish. Then you will notice
> when typing "override", you are provided with the virtual methods and
> properties from your data adapter and can manipulate the class without
> having to "inherit" from it.
>
> 2, Where have all the assemblies gone?
>
> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\%app
> name%\
> and then followed by intertwined assembly directories and cache created by
> the runtime, e.g. agentonline\88ab2d2c\588ae2f5\ and then you will find
> your assemblies such as App_Browsers.dll, App_Code.dll,
> App_Web_wu_bfbz-.dll, etc.
>
> Hope this helps you out.
>
> Regards,
> Chad
>
>
> "Scott M." <s-(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I've asked this before, but not gotten any clear answers, so I'd figure
>> I'd try again.
>>
>> I am an experienced ASP .NET 1.1 developer and I understand the
>> differences between an ASP .NET 2.0 "Web Site" vs an ASP .NET 2.0 "Web
>> Application" (among other things, all compiled code placed in several
>> assembly files vs. one assembly file).
>>
>> Here are my 2 questions:
>>
>> ASP .NET 2.0 "Web Application Project"
>> =============================
>> In ASP .NET 1.1, when you use a DataAdapter (say with the DataAdapter
>> Configuration Wizard), you'd be able to see all the wizard's generated
>> code in the code-behind and perhaps tweak it. In ASP .NET 2.0 Web
>> Application Project, if I use a TableAdapter and configure it using the
>> designer, I can't find any code (yes, I know to look in the designer.vb
>> file, rather than the code-behind) for it.
>>
>> Where is the code that makes all this new cool ASP .NET stuff work with
>> some configuration? I know I can't just see the underlying code for the
>> class, but I want to see the code for the instance. Where is it?!
>>
>> ASP .NET 2.0 "Web Site"
>> ==================
>> Where are the compiled assembly files placed? I don't see them anywhere
>> in my site's directory structure.
>>
>>
>> No offense, but please only respond if you *know* the answers, not if you
>> just have suggestions on where I *could* look.
>>
>> Thanks,
>>
>> Scott
>>

>
>



 
Reply With Quote
 
Chad Scharf
Guest
Posts: n/a
 
      12th Oct 2007
Yes, that's what I meant. Sorry.


"Scott M." <s-(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> It seems to me that by having to generate the code for, say a TableAdapter
> at runtime, the application execution would be slowed. Do you mean that
> this code is generated at build time and then added to the assembly?
>
> Thanks Chad!
>
>
>
> "Chad Scharf" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I will attempt to answer your questions here without upsetting you too
>>much as I'm pretty sure I "know" the answers to your questions:
>>
>> 1, Where's the data adapter code?
>>
>> In 2.0, in the web application project, XSD designers including data
>> adapters are considered partial classes. They are also compiled and the
>> code is generated for them at run-time. Therefore, there is no code to
>> view. If you want to override a method or property, add attributes,
>> directives or change the way those adapters work or map outside of the
>> designer, simply create a new code file in your App_Code directory and
>> define a class (in your dataset adapters namespace) called the exact same
>> name as the data adapter and mark it as partial (e.g. public partial
>> class MyDataTableAdapter), no need for inheritence, this will already be
>> set up for you, you can however add interfaces if you wish. Then you will
>> notice when typing "override", you are provided with the virtual methods
>> and properties from your data adapter and can manipulate the class
>> without having to "inherit" from it.
>>
>> 2, Where have all the assemblies gone?
>>
>> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
>> Files\%app name%\
>> and then followed by intertwined assembly directories and cache created
>> by the runtime, e.g. agentonline\88ab2d2c\588ae2f5\ and then you will
>> find your assemblies such as App_Browsers.dll, App_Code.dll,
>> App_Web_wu_bfbz-.dll, etc.
>>
>> Hope this helps you out.
>>
>> Regards,
>> Chad
>>
>>
>> "Scott M." <s-(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> I've asked this before, but not gotten any clear answers, so I'd figure
>>> I'd try again.
>>>
>>> I am an experienced ASP .NET 1.1 developer and I understand the
>>> differences between an ASP .NET 2.0 "Web Site" vs an ASP .NET 2.0 "Web
>>> Application" (among other things, all compiled code placed in several
>>> assembly files vs. one assembly file).
>>>
>>> Here are my 2 questions:
>>>
>>> ASP .NET 2.0 "Web Application Project"
>>> =============================
>>> In ASP .NET 1.1, when you use a DataAdapter (say with the DataAdapter
>>> Configuration Wizard), you'd be able to see all the wizard's generated
>>> code in the code-behind and perhaps tweak it. In ASP .NET 2.0 Web
>>> Application Project, if I use a TableAdapter and configure it using the
>>> designer, I can't find any code (yes, I know to look in the designer.vb
>>> file, rather than the code-behind) for it.
>>>
>>> Where is the code that makes all this new cool ASP .NET stuff work with
>>> some configuration? I know I can't just see the underlying code for the
>>> class, but I want to see the code for the instance. Where is it?!
>>>
>>> ASP .NET 2.0 "Web Site"
>>> ==================
>>> Where are the compiled assembly files placed? I don't see them anywhere
>>> in my site's directory structure.
>>>
>>>
>>> No offense, but please only respond if you *know* the answers, not if
>>> you just have suggestions on where I *could* look.
>>>
>>> Thanks,
>>>
>>> Scott
>>>

>>
>>

>
>



 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      12th Oct 2007
question 1:

the fundamental change with .net 2.0 was implementation of partial
classes. this changed the way designers worked.

in 1.1 they generated code il code that was then converted to the
language of choice, so that the source could be edited (sometimes by the
designer only) if needed.

in 2.0 the designer just produces il code, because it can be merged with
a language source file to produce one class. there are no hidden source
files, because they are not created anymore. this is way you can not
find the tableadapter code.

the only way to see the designer source code is to find the assembly it
ended up in (easier if in the app_code folder or seperate project, as
only one assembly is created) and recompile it (or use reflector).



question 2:

..net 2.0 (just like 1.0) creates temp folders that the web site is
copied to and compiled. where these folders are depends on configuration
but the default is under the .net installation folder.

just like 1.1 the folder are really a hashed set, with a folder for each
assembly and rev (say a recompiel of one page).

also just like 1.1 a assembly is created per page (for both web sites
and web applications), so finding the folder for the desired page is a
little work.

you can precompile the site to a work folder with the aspnet_compiler,
and its easier to find stuff, because all assemblies are in the bin folder.

-- bruce (sqlwork.com)


Scott M. wrote:
> I've asked this before, but not gotten any clear answers, so I'd figure I'd
> try again.
>
> I am an experienced ASP .NET 1.1 developer and I understand the differences
> between an ASP .NET 2.0 "Web Site" vs an ASP .NET 2.0 "Web Application"
> (among other things, all compiled code placed in several assembly files vs.
> one assembly file).
>
> Here are my 2 questions:
>
> ASP .NET 2.0 "Web Application Project"
> =============================
> In ASP .NET 1.1, when you use a DataAdapter (say with the DataAdapter
> Configuration Wizard), you'd be able to see all the wizard's generated code
> in the code-behind and perhaps tweak it. In ASP .NET 2.0 Web Application
> Project, if I use a TableAdapter and configure it using the designer, I
> can't find any code (yes, I know to look in the designer.vb file, rather
> than the code-behind) for it.
>
> Where is the code that makes all this new cool ASP .NET stuff work with some
> configuration? I know I can't just see the underlying code for the class,
> but I want to see the code for the instance. Where is it?!
>
> ASP .NET 2.0 "Web Site"
> ==================
> Where are the compiled assembly files placed? I don't see them anywhere in
> my site's directory structure.
>
>
> No offense, but please only respond if you *know* the answers, not if you
> just have suggestions on where I *could* look.
>
> Thanks,
>
> Scott
>
>

 
Reply With Quote
 
Phil H
Guest
Posts: n/a
 
      12th Oct 2007
One other point worth mentioning Scott. There are two different ways
of deploying an ASP.NET 2.0 web site - copying and "publish"

There is a tool for copying the web site in VS2005 which is a very
convenient way to deploy if you want to do incremental updates. It
does mean that no DLL assemblies are uploaded but caching on the web
server should compensate on a reasonably busy site where the traffic
is not spread among too many different pages.

The publish option does create a deployed site in a manner very
similar to the "release" version of ASP.NET 1.1 (i.e. a bin directory)
but according to Microsoft this method is not necessary unless it is a
very large site where traffic is spread over a lot if different pages.

HTH


On 12 Oct, 21:25, "Chad Scharf" <chadsch...@community.nospam> wrote:
> Yes, that's what I meant. Sorry.
>
> "Scott M." <s-...@nospam.nospam> wrote in message
>
> news:%(E-Mail Removed)...
>
>
>
> > It seems to me that by having to generate the code for, say a TableAdapter
> > at runtime, the application execution would be slowed. Do you mean that
> > this code is generated at build time and then added to the assembly?

>
> > Thanks Chad!

>
> > "Chad Scharf" <chadsch...@community.nospam> wrote in message
> >news:(E-Mail Removed)...
> >>I will attempt to answer your questions here without upsetting you too
> >>much as I'm pretty sure I "know" the answers to your questions:

>
> >> 1, Where's the data adapter code?

>
> >> In 2.0, in the web application project, XSD designers including data
> >> adapters are considered partial classes. They are also compiled and the
> >> code is generated for them at run-time. Therefore, there is no code to
> >> view. If you want to override a method or property, add attributes,
> >> directives or change the way those adapters work or map outside of the
> >> designer, simply create a new code file in your App_Code directory and
> >> define a class (in your dataset adapters namespace) called the exact same
> >> name as the data adapter and mark it as partial (e.g. public partial
> >> class MyDataTableAdapter), no need for inheritence, this will already be
> >> set up for you, you can however add interfaces if you wish. Then you will
> >> notice when typing "override", you are provided with the virtual methods
> >> and properties from your data adapter and can manipulate the class
> >> without having to "inherit" from it.

>
> >> 2, Where have all the assemblies gone?

>
> >> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
> >> Files\%app name%\
> >> and then followed by intertwined assembly directories and cache created
> >> by the runtime, e.g. agentonline\88ab2d2c\588ae2f5\ and then you will
> >> find your assemblies such as App_Browsers.dll, App_Code.dll,
> >> App_Web_wu_bfbz-.dll, etc.

>
> >> Hope this helps you out.

>
> >> Regards,
> >> Chad

>
> >> "Scott M." <s-...@nospam.nospam> wrote in message
> >>news:(E-Mail Removed)...
> >>> I've asked this before, but not gotten any clear answers, so I'd figure
> >>> I'd try again.

>
> >>> I am an experienced ASP .NET 1.1 developer and I understand the
> >>> differences between an ASP .NET 2.0 "Web Site" vs an ASP .NET 2.0 "Web
> >>> Application" (among other things, all compiled code placed in several
> >>> assembly files vs. one assembly file).

>
> >>> Here are my 2 questions:

>
> >>> ASP .NET 2.0 "Web Application Project"
> >>> =============================
> >>> In ASP .NET 1.1, when you use a DataAdapter (say with the DataAdapter
> >>> Configuration Wizard), you'd be able to see all the wizard's generated
> >>> code in the code-behind and perhaps tweak it. In ASP .NET 2.0 Web
> >>> Application Project, if I use a TableAdapter and configure it using the
> >>> designer, I can't find any code (yes, I know to look in the designer.vb
> >>> file, rather than the code-behind) for it.

>
> >>> Where is the code that makes all this new cool ASP .NET stuff work with
> >>> some configuration? I know I can't just see the underlying code for the
> >>> class, but I want to see the code for the instance. Where is it?!

>
> >>> ASP .NET 2.0 "Web Site"
> >>> ==================
> >>> Where are the compiled assembly files placed? I don't see them anywhere
> >>> in my site's directory structure.

>
> >>> No offense, but please only respond if you *know* the answers, not if
> >>> you just have suggestions on where I *could* look.

>
> >>> Thanks,

>
> >>> Scott- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
Rory Becker
Guest
Posts: n/a
 
      12th Oct 2007
> also just like 1.1 a assembly is created per page
>

erm .. unless I'm missing something serious..... thats just wrong.. My understanding
is that this is now true for a "web site" in ASP.Net 2.0 but was not true
for ASP.Net 1.1 and is not true for ASP.Net "Web Applications"

"Web applications" and "Web Sites" are 2 different project types in VS 2005.
I thought that Web Applications followed the Old rules(1 Dll per project)
and that the Web Sites followed the alternative view of 1 dll per page.

This was originally the only web project type in VS2005 and Web Applications
were then added back by popular demand via a ctp (or something like that)
and then later made more concrete via SP1.

Did I miss somthing?
--
Rory


 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      12th Oct 2007
Hi Bruce,

Thanks for the explanations. I have a couple of comments questions,
inline....


> question 2:
>
> .net 2.0 (just like 1.0) creates temp folders that the web site is copied
> to and compiled. where these folders are depends on configuration but the
> default is under the .net installation folder.


Yes, but in 1.1 the initial IL assembly was placed in the /bin folder of the
ASP .NET project directory. ASP .NET Web Sites don't seem to have this?
That is what I was inquiring about.

> also just like 1.1 a assembly is created per page (for both web sites and
> web applications), so finding the folder for the desired page is a little
> work.


??? In 1.1 there was not one assembly per page. There was one assembly per
project. You could have 1000 pages and just one assembly.

>
> you can precompile the site to a work folder with the aspnet_compiler, and
> its easier to find stuff, because all assemblies are in the bin folder.


Is that NGen or someting else that pre-comiles it?

Thanks Bruce!


 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      12th Oct 2007
"Rory Becker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

>> also just like 1.1 a assembly is created per page
>>

> erm .. unless I'm missing something serious..... that's just wrong..


It is wrong.

> My understanding is that this is now true for a "web site" in ASP.Net 2.0
> but was not true for ASP.Net 1.1 and is not true for ASP.Net "Web
> Applications"


That is correct.

> "Web applications" and "Web Sites" are 2 different project types in VS
> 2005.


Correct.

> I thought that Web Applications followed the Old rules(1 Dll per project)
> and that the Web Sites followed the alternative view of 1 dll per page.
> This was originally the only web project type in VS2005 and Web
> Applications were then added back by popular demand via a ctp (or
> something like that) and then later made more concrete via SP1.


Right again.

> Did I miss somthing?


Not really, though Web Deployment Projects add some extra options...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
Rory Becker
Guest
Posts: n/a
 
      12th Oct 2007
>> Did I miss somthing?
>>

> Not really, though Web Deployment Projects add some extra options...



Cheers man. For a moment there, I thought I'd slipped into a parallell world
or something.
It's been the type of week where that might have explained a lot of things

--
Rory


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unanswered questions gg Microsoft Access 1 15th Dec 2009 07:50 PM
Re: Unanswered questions Steve Microsoft Access 1 15th Dec 2009 06:56 PM
Unanswered questions =?Utf-8?B?Um9nZXI=?= Microsoft Dot NET 2 23rd May 2007 07:15 PM
3 unanswered questions: =?Utf-8?B?ZmlsbzY2Ng==?= Microsoft Excel Programming 0 8th Dec 2005 06:07 PM
Unanswered Questions Scott Microsoft Access 5 27th Mar 2004 12:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:23 AM.