473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

bin folder?

Microsoft documentation states:
Bin Folder
You can store compiled assemblies in the Bin folder, and other code anywhere
in the Web application (such as code for pages) automatically references it.
A typical example is that you have the compiled code for a custom class. You
can copy the compiled assembly to the Bin folder of your Web application and
the class is then available to all pages.

Assemblies in the Bin folder do not need to be registered. The presence of a
..dll file in the Bin folder is sufficient for ASP.NET to recognize it. If you
change the .dll and write a new version of it to the Bin folder, ASP.NET
detects the update and uses the new version of the .dll for new page requests
from then on.

So my question is: Why in the @register directive do you need the assembly
value to register a tag? Shouldn't the assembly just be available? If not,
what does the microsoft documentation mean when it says dlls here are
available to the entire site?

-Ben
Apr 17 '06 #1
4 1472
In order to load a type efficiently, the assembly name must be available.

The only way to load a type from the class's full name is to loop through
all loaded assemblies in the GAC and check each one. This would mean
System.dll, System.Web.dll and probably 15 more assemblies would need to be
checked. Certainly not the best way to go about.

Also, having the assembly name greatly increases the maintainability and
readability of your code.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Ben R." <be**@newsgroup.nospam> wrote in message
news:EA**********************************@microsof t.com...
Microsoft documentation states:
Bin Folder
You can store compiled assemblies in the Bin folder, and other code
anywhere
in the Web application (such as code for pages) automatically references
it.
A typical example is that you have the compiled code for a custom class.
You
can copy the compiled assembly to the Bin folder of your Web application
and
the class is then available to all pages.

Assemblies in the Bin folder do not need to be registered. The presence of
a
.dll file in the Bin folder is sufficient for ASP.NET to recognize it. If
you
change the .dll and write a new version of it to the Bin folder, ASP.NET
detects the update and uses the new version of the .dll for new page
requests
from then on.

So my question is: Why in the @register directive do you need the assembly
value to register a tag? Shouldn't the assembly just be available? If not,
what does the microsoft documentation mean when it says dlls here are
available to the entire site?

-Ben

Apr 17 '06 #2
Hi Ben,

As Karl has mentioned, though the ASP.NET runtime can always loop all the
assemblies in the private bin dir to locate a certain type, use explicit
assembly name can make the process more effecient. In addition, ASP.NET
will utilize dynamic compilation (and it is the main compilation model in
ASP.NET 2.0), then there may exists dynamic compiled assembly which may
reference other assemblies (in private bin) dir, explicitly provide the
assembly name can also help the compilation process simplified
(conveniently add the reference to dependent assemblies).

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 18 '06 #3
Hi Steven,

Thaks for the response. Do I understand correctly that the addition of the
"assembly" keyword is optional but enhances performance? In my testing,
removing the keyword broke the assembly reference. And what about for types
that are placed in the app_code folder? I was under the impression that those
are compiled into the main website assembly and thus the keyword can be
omitted. Also, could you elaborate on how this ties to dynamic compilation?
I'm not sure I follow.

Thanks again Steven...

-Ben
"Steven Cheng[MSFT]" wrote:
Hi Ben,

As Karl has mentioned, though the ASP.NET runtime can always loop all the
assemblies in the private bin dir to locate a certain type, use explicit
assembly name can make the process more effecient. In addition, ASP.NET
will utilize dynamic compilation (and it is the main compilation model in
ASP.NET 2.0), then there may exists dynamic compiled assembly which may
reference other assemblies (in private bin) dir, explicitly provide the
assembly name can also help the compilation process simplified
(conveniently add the reference to dependent assemblies).

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 18 '06 #4
Thanks for your response Ben,

Though it is used for improve performance, we can not ignore it as we like,
must followup the rule mentioned in MSDN. Actually the @Regiser directive
can be used for register both ascx usercontrol and webserver control. In
two cases , the requirement are different.

#@ Register
http://msdn2.microsoft.com/en-us/lib...k1(VS.80).aspx

And the "assembly", "namespace" attribute are always required for webserver
control, if the control is defined in classes within "App_Code" folder,
the "assembly" attribute's value can be set as "App_Code" or "__code", e.g:

<%@ Register TagPrefix="ac" Namespace="test" Assembly="__code" %>

And for 1.1 ASP.NET appliation, the VS IDE will compile codebehind and
other source classes into a main assembly. Hoewver, for 2.0, this is not
the case, 2.0 ASP.NET application utilize dynamic compilation, page classes
and other source classes in App_Code folder may be compiled into different
dynamic assemblies. And for page classes and classes in App_code, the
runtime know how to locate them in those dynamic compiled assemblies.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.





Apr 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: jenny | last post by:
Hi, I am trying to find a VB way that would create a folder on all existing drives - the folder name would be the same on each drive. ie c:\backup, d:\backup, etc. But the folders would only be...
0
by: John H. | last post by:
In effort to understand (Outlook) MAPI folder tree structure wrote simple linear code below to navigate tree. Successive "...Folders.GetNext()"'s return same folder at all levels of tree. What...
9
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3)...
17
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 -...
24
by: biganthony via AccessMonster.com | last post by:
Hi, I have the following code to select a folder and then delete it. I keep getting a Path/File error on the line that deletes the actual folder. The line before that line deletes the files in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.