473,396 Members | 1,683 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,396 software developers and data experts.

asp.net assembly best practices question...

Hello,

I am trying to use vs.net 2005 to migrate a project originally in vs.net
2003. I started with creation of a "web site", and then created folders for
each component of the site.

I read somewhere that each folder under the "web site" is compiled in
separate assembly. I however, did not find that the "web site" creation in
vs.net 2005 created any AssemblyInfo.cs file.

If I include such a file manually, will I be able to control the assembly
version in this way? if not, what is the correct way of doing this.

I have however noticed that any other type of projects (like C# library)
indeed creates a property folder and the AssemblyInfo.cs in it.

Thanks

--
-jojobar
Nov 19 '05 #1
10 3407
Hi Jojobar,

Welcome to ASP.NET newsgroup.
Regarding on the problem of the assembly compilation in ASP.NET 2.0 , yes,
it does be much different from the 1.x's style. First, regardless of the
VS.NET 2005 IDE, the asp.net 2.0 use the new dynamic compilation model. In
this model, each aspx page's codebehind file and other source code
(component class, xsd.... ) put in the App_Code code will be automatically
compiled at runtime. And the assemblies are in the asp.net temporary dir.
That's why we no longer see a precompiled dll in the "bin" sub dir(all
those page classes and other components are dynamic compiled). Thus, we do
not have the assemblyInfo code file for specifying asembly attrributes for
those dynamic compiled ones. In addition, the assembly reference info are
put into web.config file. So there is event no project file needed for
ASP.NET project in VS.NET 2005. This is a good feature which come from many
feedbacks in the former version.
In addition, if you need to specify assembly info for some components
class, we can consider separate them out of the web project and put in an
external class library project and reference it in web application/project.
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: asp.net assembly best practices question...
| thread-index: AcXZ2wkYrEyRUnmkTaab75t1X9ftuQ==
| X-WBNR-Posting-Host: 24.30.72.206
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| Subject: asp.net assembly best practices question...
| Date: Tue, 25 Oct 2005 20:12:02 -0700
| Lines: 20
| Message-ID: <97**********************************@microsoft.co m>
| 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.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:133843
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello,
|
| I am trying to use vs.net 2005 to migrate a project originally in vs.net
| 2003. I started with creation of a "web site", and then created folders
for
| each component of the site.
|
| I read somewhere that each folder under the "web site" is compiled in
| separate assembly. I however, did not find that the "web site" creation
in
| vs.net 2005 created any AssemblyInfo.cs file.
|
| If I include such a file manually, will I be able to control the assembly
| version in this way? if not, what is the correct way of doing this.
|
| I have however noticed that any other type of projects (like C# library)
| indeed creates a property folder and the AssemblyInfo.cs in it.
|
| Thanks
|
| --
| -jojobar
|

Nov 19 '05 #2
Thanks for the reply, I have a specific question:

So far we worked in asp 1.1 and it had let me control the assembly version
using the assemblyinfo file. This helps me to version our software correctly
and keep track of the assembly in all our versions.

With 2.0 I am trying to see if I can make that jump to new ways of doing
things. Our application has many components like calendar, document
management, tasks etc. With 1.1 each of these were different C# projects and
a dll was created for each of them and we could version it correctly. After
reading Scott Guthrie blogs, I figured that it will be great to have one web
project and have these components as separate directories.

These are the problems I am having:

1. If I cannot have assembly info, how can I version the assemblies? I
checked up in the .net temp directory where the assemblies are created and it
shows the version as 0.0.0.0. Is there any way we can version these
assemblies so that we can keep track of things when they go to the client
site?

2. I also plan to use assemblyinfo to define things so that I can embed
javascript files in the assembly (using webresource.axd). I figured out how
to do this in assemblyinfo but do not know how to do it otherwise.

3. Also, putting things in APP_Code is difficult for me. I do understand
what it does, but our current projects also has a lot of C# helper files (in
addition to aspx.cs and ascx.cs files), I understand they will need explicit
compilation if I do not put them in the APP_code and keep them in their
respective directories. Will compiling the web site compile these files
automatically (if they are not in APP_Code directory but in normal folders)?

I would like to follow the best practices in our project but am struggling
how we can avoid drastic changes in our code base (over 3000 program files)
while doing this.

Kind Regards

--
-jojobar
"Steven Cheng[MSFT]" wrote:
Hi Jojobar,

Welcome to ASP.NET newsgroup.
Regarding on the problem of the assembly compilation in ASP.NET 2.0 , yes,
it does be much different from the 1.x's style. First, regardless of the
VS.NET 2005 IDE, the asp.net 2.0 use the new dynamic compilation model. In
this model, each aspx page's codebehind file and other source code
(component class, xsd.... ) put in the App_Code code will be automatically
compiled at runtime. And the assemblies are in the asp.net temporary dir.
That's why we no longer see a precompiled dll in the "bin" sub dir(all
those page classes and other components are dynamic compiled). Thus, we do
not have the assemblyInfo code file for specifying asembly attrributes for
those dynamic compiled ones. In addition, the assembly reference info are
put into web.config file. So there is event no project file needed for
ASP.NET project in VS.NET 2005. This is a good feature which come from many
feedbacks in the former version.
In addition, if you need to specify assembly info for some components
class, we can consider separate them out of the web project and put in an
external class library project and reference it in web application/project.
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: asp.net assembly best practices question...
| thread-index: AcXZ2wkYrEyRUnmkTaab75t1X9ftuQ==
| X-WBNR-Posting-Host: 24.30.72.206
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| Subject: asp.net assembly best practices question...
| Date: Tue, 25 Oct 2005 20:12:02 -0700
| Lines: 20
| Message-ID: <97**********************************@microsoft.co m>
| 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.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:133843
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello,
|
| I am trying to use vs.net 2005 to migrate a project originally in vs.net
| 2003. I started with creation of a "web site", and then created folders
for
| each component of the site.
|
| I read somewhere that each folder under the "web site" is compiled in
| separate assembly. I however, did not find that the "web site" creation
in
| vs.net 2005 created any AssemblyInfo.cs file.
|
| If I include such a file manually, will I be able to control the assembly
| version in this way? if not, what is the correct way of doing this.
|
| I have however noticed that any other type of projects (like C# library)
| indeed creates a property folder and the AssemblyInfo.cs in it.
|
| Thanks
|
| --
| -jojobar
|

Nov 19 '05 #3
On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar" <jo*****@nospam.nospam>
wrote:

1. If I cannot have assembly info, how can I version the assemblies? I
checked up in the .net temp directory where the assemblies are created and it
shows the version as 0.0.0.0. Is there any way we can version these
assemblies so that we can keep track of things when they go to the client
site?

I believe we will have to wait until RTM when the ASP.NET team
provides us with a build and deployment project. One feature of the
tool is supposed to be a post compilation step that will merge all
generated assemblies into a single assembly - I'm thinking this will
be easy to stamp with a version.

3. Also, putting things in APP_Code is difficult for me. I do understand
what it does, but our current projects also has a lot of C# helper files (in
addition to aspx.cs and ascx.cs files), I understand they will need explicit
compilation if I do not put them in the APP_code and keep them in their
respective directories. Will compiling the web site compile these files
automatically (if they are not in APP_Code directory but in normal folders)?

You have to have stand alone code files in App_Code for the runtime to
compile and properly reference them from the web assemblies. Just drop
the .cs / .vb files in App_Code, or a subdirectory of App_Code, and
the runtime does the rest. If you want to logically organize the
files, you can place them in subdirs of App_Code, or into seperate
class libraries.

Make sense?

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #4
Hello Scott,

Thanks for replying. I read in scottgu's blog that MS is trying to combine
the assemblies in folders in a website. That will be great!

From your reply I gather that if I have xxx.aspx, xxx.aspx.cs and support.cs
(where support.cs only has support functions for the xxx.aspx.cs) in a folder
and compile the web site, it will not compile it correctly. However, if I
copy support.cs in APP_Code it will!

I have not tested it yet, but my understanding was that putting in APP_Code
will compile it automatically, but you still have an option to compile it
yourself elsewhere (in the web site) if you want to. Putting things in
APP_Code is not a big deal, but I am trying to find if this is forced or an
option.

Also, I was wondering how to put the .js files into assembly (using .axd) in
a web site, if there is no way to define attributes for the assembly (usually
you define this in the assemblyinfo.cs file).

Thanks
--
-jojobar
"Scott Allen" wrote:
On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar" <jo*****@nospam.nospam>
wrote:

1. If I cannot have assembly info, how can I version the assemblies? I
checked up in the .net temp directory where the assemblies are created and it
shows the version as 0.0.0.0. Is there any way we can version these
assemblies so that we can keep track of things when they go to the client
site?


I believe we will have to wait until RTM when the ASP.NET team
provides us with a build and deployment project. One feature of the
tool is supposed to be a post compilation step that will merge all
generated assemblies into a single assembly - I'm thinking this will
be easy to stamp with a version.

3. Also, putting things in APP_Code is difficult for me. I do understand
what it does, but our current projects also has a lot of C# helper files (in
addition to aspx.cs and ascx.cs files), I understand they will need explicit
compilation if I do not put them in the APP_code and keep them in their
respective directories. Will compiling the web site compile these files
automatically (if they are not in APP_Code directory but in normal folders)?

You have to have stand alone code files in App_Code for the runtime to
compile and properly reference them from the web assemblies. Just drop
the .cs / .vb files in App_Code, or a subdirectory of App_Code, and
the runtime does the rest. If you want to logically organize the
files, you can place them in subdirs of App_Code, or into seperate
class libraries.

Make sense?

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #5
Okay I found another thing which looks interesting.

If I put an assembly info file in APP_Code folder, then an assembly is
created in the .net temporary folder called App_Code.rnuvm4pf.dll, which
picked up the assembly version correctly. However, if it is kept outside the
App_code, the code compiles and runs fine but the assemblyinfo is not picked
up correctly in the dll (it always shows 0.0.0.0).

Thanks
--
-jojobar
"jojobar" wrote:
Hello Scott,

Thanks for replying. I read in scottgu's blog that MS is trying to combine
the assemblies in folders in a website. That will be great!

From your reply I gather that if I have xxx.aspx, xxx.aspx.cs and support.cs
(where support.cs only has support functions for the xxx.aspx.cs) in a folder
and compile the web site, it will not compile it correctly. However, if I
copy support.cs in APP_Code it will!

I have not tested it yet, but my understanding was that putting in APP_Code
will compile it automatically, but you still have an option to compile it
yourself elsewhere (in the web site) if you want to. Putting things in
APP_Code is not a big deal, but I am trying to find if this is forced or an
option.

Also, I was wondering how to put the .js files into assembly (using .axd) in
a web site, if there is no way to define attributes for the assembly (usually
you define this in the assemblyinfo.cs file).

Thanks
--
-jojobar
"Scott Allen" wrote:
On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar" <jo*****@nospam.nospam>
wrote:

1. If I cannot have assembly info, how can I version the assemblies? I
checked up in the .net temp directory where the assemblies are created and it
shows the version as 0.0.0.0. Is there any way we can version these
assemblies so that we can keep track of things when they go to the client
site?


I believe we will have to wait until RTM when the ASP.NET team
provides us with a build and deployment project. One feature of the
tool is supposed to be a post compilation step that will merge all
generated assemblies into a single assembly - I'm thinking this will
be easy to stamp with a version.

3. Also, putting things in APP_Code is difficult for me. I do understand
what it does, but our current projects also has a lot of C# helper files (in
addition to aspx.cs and ascx.cs files), I understand they will need explicit
compilation if I do not put them in the APP_code and keep them in their
respective directories. Will compiling the web site compile these files
automatically (if they are not in APP_Code directory but in normal folders)?

You have to have stand alone code files in App_Code for the runtime to
compile and properly reference them from the web assemblies. Just drop
the .cs / .vb files in App_Code, or a subdirectory of App_Code, and
the runtime does the rest. If you want to logically organize the
files, you can place them in subdirs of App_Code, or into seperate
class libraries.

Make sense?

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #6
Thanks for your response Jojobar,

Here are some of my understanding and suggestions regarding on the
questions you mentioned:

1. If I cannot have assembly info, how can I version the assemblies? I
checked up in the .net temp directory where the assemblies are created and
it
shows the version as 0.0.0.0. Is there any way we can version these
assemblies so that we can keep track of things when they go to the client
site?
=======================================
I'm afraid currently for the dynamic compiled assembly we can not version
them as class library or other precompiled ones.
2. I also plan to use assemblyinfo to define things so that I can embed
javascript files in the assembly (using webresource.axd). I figured out how
to do this in assemblyinfo but do not know how to do it otherwise.
=======================================
As for embeded webresource, the ASP.NET 2.0 project dosn't quite support
it, you can find that the image or other resource files in the asp.net
project does not contain the "Build Action" to let dynamic compilation
embeded them. So the [assembly:WebResource(...)] dosn't make sense in
asp.net 2.0 web project. Actually, this is not necessary because dynamic
resource emitting is mainly target webcontrol developing, since webcontrol
provider can not deliver physical files to web application developers and
let them put in web dir. However, for asp.net app developing, since we can
diretory manage the website's dir and files, we can just put those static
resoures file in application's sub dirs so as to accessing them directly
(instead of the through the webresource.axd). static files request will
have much more improved performance than handling by webresource.axd.
3. Also, putting things in APP_Code is difficult for me. I do understand
what it does, but our current projects also has a lot of C# helper files
(in
addition to aspx.cs and ascx.cs files), I understand they will need
explicit
compilation if I do not put them in the APP_code and keep them in their
respective directories. Will compiling the web site compile these files
automatically (if they are not in APP_Code directory but in normal folders)?
=======================================
For such scenario, I think the best choice should be still separating the
components/controls and helper classes in external class library so as to
explictily version them or apply other assembly level attributes. Also,
compile the website won't compile the code which is not in App_Code or
codebehind files.
4.If I put an assembly info file in APP_Code folder, then an assembly is
created in the .net temporary folder called App_Code.rnuvm4pf.dll, which
picked up the assembly version correctly. However, if it is kept outside
the
App_code, the code compiles and runs fine but the assemblyinfo is not
picked
up correctly in the dll (it always shows 0.0.0.0).
=======================================
yes, we can manually put a source code file (not necessarily named as
"AssemblyInfo") and put [assembly:XXX(...)] attributes in it so as to
embeded in the dynamic generated assemblies. However, the dynamic
compilation of the source code in App_Code do not gurantee that the file
which contains those assembly level attributes will be compiled into a
fixed assembly ( e.g. always together with other source files in the
App_Code). In other words, the source code files in the App_code folder
maybe dynamically compiled into multi assemblies, and we can not make sure
which assembly actually contains the assembly version info.

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: asp.net assembly best practices question...
| thread-index: AcXaZeTkcv8kMaHPQSyHovYFJeJngA==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<Q#**************@TK2MSFTNGXA01.phx.gbl>
<5F**********************************@microsoft.co m>
<ld********************************@4ax.com>
<ED**********************************@microsoft.co m>
| Subject: Re: asp.net assembly best practices question...
| Date: Wed, 26 Oct 2005 12:46:01 -0700
| Lines: 82
| Message-ID: <3B**********************************@microsoft.co m>
| 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.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134088
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Okay I found another thing which looks interesting.
|
| If I put an assembly info file in APP_Code folder, then an assembly is
| created in the .net temporary folder called App_Code.rnuvm4pf.dll, which
| picked up the assembly version correctly. However, if it is kept outside
the
| App_code, the code compiles and runs fine but the assemblyinfo is not
picked
| up correctly in the dll (it always shows 0.0.0.0).
|
| Thanks
| --
| -jojobar
|
|
| "jojobar" wrote:
|
| > Hello Scott,
| >
| > Thanks for replying. I read in scottgu's blog that MS is trying to
combine
| > the assemblies in folders in a website. That will be great!
| >
| > From your reply I gather that if I have xxx.aspx, xxx.aspx.cs and
support.cs
| > (where support.cs only has support functions for the xxx.aspx.cs) in a
folder
| > and compile the web site, it will not compile it correctly. However, if
I
| > copy support.cs in APP_Code it will!
| >
| > I have not tested it yet, but my understanding was that putting in
APP_Code
| > will compile it automatically, but you still have an option to compile
it
| > yourself elsewhere (in the web site) if you want to. Putting things in
| > APP_Code is not a big deal, but I am trying to find if this is forced
or an
| > option.
| >
| > Also, I was wondering how to put the .js files into assembly (using
..axd) in
| > a web site, if there is no way to define attributes for the assembly
(usually
| > you define this in the assemblyinfo.cs file).
| >
| > Thanks
| > --
| > -jojobar
| >
| >
| > "Scott Allen" wrote:
| >
| > > On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar" <jo*****@nospam.nospam>
| > > wrote:
| > >
| > > >
| > > >1. If I cannot have assembly info, how can I version the assemblies?
I
| > > >checked up in the .net temp directory where the assemblies are
created and it
| > > >shows the version as 0.0.0.0. Is there any way we can version these
| > > >assemblies so that we can keep track of things when they go to the
client
| > > >site?
| > > >
| > >
| > > I believe we will have to wait until RTM when the ASP.NET team
| > > provides us with a build and deployment project. One feature of the
| > > tool is supposed to be a post compilation step that will merge all
| > > generated assemblies into a single assembly - I'm thinking this will
| > > be easy to stamp with a version.
| > >
| > > >
| > > >3. Also, putting things in APP_Code is difficult for me. I do
understand
| > > >what it does, but our current projects also has a lot of C# helper
files (in
| > > >addition to aspx.cs and ascx.cs files), I understand they will need
explicit
| > > >compilation if I do not put them in the APP_code and keep them in
their
| > > >respective directories. Will compiling the web site compile these
files
| > > >automatically (if they are not in APP_Code directory but in normal
folders)?
| > > >
| > >
| > >
| > > You have to have stand alone code files in App_Code for the runtime to
| > > compile and properly reference them from the web assemblies. Just drop
| > > the .cs / .vb files in App_Code, or a subdirectory of App_Code, and
| > > the runtime does the rest. If you want to logically organize the
| > > files, you can place them in subdirs of App_Code, or into seperate
| > > class libraries.
| > >
| > > Make sense?
| > >
| > > --
| > > Scott
| > > http://www.OdeToCode.com/blogs/scott/
| > >
|

Nov 19 '05 #7
I thought that another advantage of webresource.axd is it can cache the
javascript file and automatically refresh them in the next build. Keeping js
files in static folder tends to cache them the first time they are used and
the browser keep using the cached file even when the original file is
changed(unless you change the file name ofcourse or clear the cache). I was
trying to cache the js files in another c# project and use the resource in
the web project (using the namespace).

So far no success, maybe I am doing something wrong!
For such scenario, I think the best choice should be still separating the
components/controls and helper classes in external class library so as to
explictily version them or apply other assembly level attributes. Also,
compile the website won't compile the code which is not in App_Code or
codebehind files.
This is a bit of restriction. but we can live with it! :-)

Thanks again
jojobar

--
-jojobar
"Steven Cheng[MSFT]" wrote:
Thanks for your response Jojobar,

Here are some of my understanding and suggestions regarding on the
questions you mentioned:

1. If I cannot have assembly info, how can I version the assemblies? I
checked up in the .net temp directory where the assemblies are created and
it
shows the version as 0.0.0.0. Is there any way we can version these
assemblies so that we can keep track of things when they go to the client
site?
=======================================
I'm afraid currently for the dynamic compiled assembly we can not version
them as class library or other precompiled ones.
2. I also plan to use assemblyinfo to define things so that I can embed
javascript files in the assembly (using webresource.axd). I figured out how
to do this in assemblyinfo but do not know how to do it otherwise.
=======================================
As for embeded webresource, the ASP.NET 2.0 project dosn't quite support
it, you can find that the image or other resource files in the asp.net
project does not contain the "Build Action" to let dynamic compilation
embeded them. So the [assembly:WebResource(...)] dosn't make sense in
asp.net 2.0 web project. Actually, this is not necessary because dynamic
resource emitting is mainly target webcontrol developing, since webcontrol
provider can not deliver physical files to web application developers and
let them put in web dir. However, for asp.net app developing, since we can
diretory manage the website's dir and files, we can just put those static
resoures file in application's sub dirs so as to accessing them directly
(instead of the through the webresource.axd). static files request will
have much more improved performance than handling by webresource.axd.
3. Also, putting things in APP_Code is difficult for me. I do understand
what it does, but our current projects also has a lot of C# helper files
(in
addition to aspx.cs and ascx.cs files), I understand they will need
explicit
compilation if I do not put them in the APP_code and keep them in their
respective directories. Will compiling the web site compile these files
automatically (if they are not in APP_Code directory but in normal folders)?
=======================================
For such scenario, I think the best choice should be still separating the
components/controls and helper classes in external class library so as to
explictily version them or apply other assembly level attributes. Also,
compile the website won't compile the code which is not in App_Code or
codebehind files.
4.If I put an assembly info file in APP_Code folder, then an assembly is
created in the .net temporary folder called App_Code.rnuvm4pf.dll, which
picked up the assembly version correctly. However, if it is kept outside
the
App_code, the code compiles and runs fine but the assemblyinfo is not
picked
up correctly in the dll (it always shows 0.0.0.0).
=======================================
yes, we can manually put a source code file (not necessarily named as
"AssemblyInfo") and put [assembly:XXX(...)] attributes in it so as to
embeded in the dynamic generated assemblies. However, the dynamic
compilation of the source code in App_Code do not gurantee that the file
which contains those assembly level attributes will be compiled into a
fixed assembly ( e.g. always together with other source files in the
App_Code). In other words, the source code files in the App_code folder
maybe dynamically compiled into multi assemblies, and we can not make sure
which assembly actually contains the assembly version info.

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: asp.net assembly best practices question...
| thread-index: AcXaZeTkcv8kMaHPQSyHovYFJeJngA==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<Q#**************@TK2MSFTNGXA01.phx.gbl>
<5F**********************************@microsoft.co m>
<ld********************************@4ax.com>
<ED**********************************@microsoft.co m>
| Subject: Re: asp.net assembly best practices question...
| Date: Wed, 26 Oct 2005 12:46:01 -0700
| Lines: 82
| Message-ID: <3B**********************************@microsoft.co m>
| 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.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134088
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Okay I found another thing which looks interesting.
|
| If I put an assembly info file in APP_Code folder, then an assembly is
| created in the .net temporary folder called App_Code.rnuvm4pf.dll, which
| picked up the assembly version correctly. However, if it is kept outside
the
| App_code, the code compiles and runs fine but the assemblyinfo is not
picked
| up correctly in the dll (it always shows 0.0.0.0).
|
| Thanks
| --
| -jojobar
|
|
| "jojobar" wrote:
|
| > Hello Scott,
| >
| > Thanks for replying. I read in scottgu's blog that MS is trying to
combine
| > the assemblies in folders in a website. That will be great!
| >
| > From your reply I gather that if I have xxx.aspx, xxx.aspx.cs and
support.cs
| > (where support.cs only has support functions for the xxx.aspx.cs) in a
folder
| > and compile the web site, it will not compile it correctly. However, if
I
| > copy support.cs in APP_Code it will!
| >
| > I have not tested it yet, but my understanding was that putting in
APP_Code
| > will compile it automatically, but you still have an option to compile
it
| > yourself elsewhere (in the web site) if you want to. Putting things in
| > APP_Code is not a big deal, but I am trying to find if this is forced
or an
| > option.
| >
| > Also, I was wondering how to put the .js files into assembly (using
.axd) in
| > a web site, if there is no way to define attributes for the assembly
(usually
| > you define this in the assemblyinfo.cs file).
| >
| > Thanks
| > --
| > -jojobar
| >
| >
| > "Scott Allen" wrote:
| >
| > > On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar" <jo*****@nospam.nospam>
| > > wrote:
| > >
| > > >
| > > >1. If I cannot have assembly info, how can I version the assemblies?
I
| > > >checked up in the .net temp directory where the assemblies are
created and it
| > > >shows the version as 0.0.0.0. Is there any way we can version these
| > > >assemblies so that we can keep track of things when they go to the
client
| > > >site?
| > > >
| > >
| > > I believe we will have to wait until RTM when the ASP.NET team
| > > provides us with a build and deployment project. One feature of the
| > > tool is supposed to be a post compilation step that will merge all
| > > generated assemblies into a single assembly - I'm thinking this will
| > > be easy to stamp with a version.
| > >
| > > >
| > > >3. Also, putting things in APP_Code is difficult for me. I do
understand
| > > >what it does, but our current projects also has a lot of C# helper
files (in
| > > >addition to aspx.cs and ascx.cs files), I understand they will need
explicit
| > > >compilation if I do not put them in the APP_code and keep them in
their
| > > >respective directories. Will compiling the web site compile these
files
| > > >automatically (if they are not in APP_Code directory but in normal
folders)?
| > > >
| > >
| > >
| > > You have to have stand alone code files in App_Code for the runtime to
| > > compile and properly reference them from the web assemblies. Just drop
| > > the .cs / .vb files in App_Code, or a subdirectory of App_Code, and
| > > the runtime does the rest. If you want to logically organize the
| > > files, you can place them in subdirs of App_Code, or into seperate
| > > class libraries.
| > >
| > > Make sense?
| > >
| > > --
| > > Scott
| > > http://www.OdeToCode.com/blogs/scott/
| > >
|

Nov 19 '05 #8
Thanks for your response Jojobar,

I've also consult Scott Guthrie regarding on the questions and here are
some of his comments:

===================
We are coming out with a new deployment project on November 7th (the same
day as VS 2005 launch) that should help this customer automate building
user control assemblies. It is called the "VS 2005 Web Deployment Project"
and can be added to their solution containing the web project. It provides
several build customization options. One option it supports is to set a
version string explicitly. By default, if a version string isn't set in
the tool it will be picked up by any AssemblyInfo.cs file stored in the
app_code directory of their web project.
===================

However, for components and other helper classes, I still recommend you
keep them in separate class lib projects since that'll make redistribute
and versioning controls/components only more convenient.

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: asp.net assembly best practices question...
| thread-index: AcXa+SnlZT4gjv89RRK/q10X52ZJWA==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<Q#**************@TK2MSFTNGXA01.phx.gbl>
<5F**********************************@microsoft.co m>
<ld********************************@4ax.com>
<ED**********************************@microsoft.co m>
<3B**********************************@microsoft.co m>
<7A**************@TK2MSFTNGXA01.phx.gbl>
| Subject: Re: asp.net assembly best practices question...
| Date: Thu, 27 Oct 2005 06:20:13 -0700
| Lines: 247
| Message-ID: <07**********************************@microsoft.co m>
| 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.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134227
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I thought that another advantage of webresource.axd is it can cache the
| javascript file and automatically refresh them in the next build. Keeping
js
| files in static folder tends to cache them the first time they are used
and
| the browser keep using the cached file even when the original file is
| changed(unless you change the file name ofcourse or clear the cache). I
was
| trying to cache the js files in another c# project and use the resource
in
| the web project (using the namespace).
|
| So far no success, maybe I am doing something wrong!
|
| >For such scenario, I think the best choice should be still separating
the
| >components/controls and helper classes in external class library so as
to
| >explictily version them or apply other assembly level attributes. Also,
| >compile the website won't compile the code which is not in App_Code or
| >codebehind files.
|
| This is a bit of restriction. but we can live with it! :-)
|
| Thanks again
| jojobar
|
| --
| -jojobar
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Thanks for your response Jojobar,
| >
| > Here are some of my understanding and suggestions regarding on the
| > questions you mentioned:
| >
| > 1. If I cannot have assembly info, how can I version the assemblies? I
| > checked up in the .net temp directory where the assemblies are created
and
| > it
| > shows the version as 0.0.0.0. Is there any way we can version these
| > assemblies so that we can keep track of things when they go to the
client
| > site?
| > =======================================
| > I'm afraid currently for the dynamic compiled assembly we can not
version
| > them as class library or other precompiled ones.
| >
| >
| > 2. I also plan to use assemblyinfo to define things so that I can embed
| > javascript files in the assembly (using webresource.axd). I figured out
how
| > to do this in assemblyinfo but do not know how to do it otherwise.
| > =======================================
| > As for embeded webresource, the ASP.NET 2.0 project dosn't quite
support
| > it, you can find that the image or other resource files in the asp.net
| > project does not contain the "Build Action" to let dynamic compilation
| > embeded them. So the [assembly:WebResource(...)] dosn't make sense in
| > asp.net 2.0 web project. Actually, this is not necessary because
dynamic
| > resource emitting is mainly target webcontrol developing, since
webcontrol
| > provider can not deliver physical files to web application developers
and
| > let them put in web dir. However, for asp.net app developing, since we
can
| > diretory manage the website's dir and files, we can just put those
static
| > resoures file in application's sub dirs so as to accessing them
directly
| > (instead of the through the webresource.axd). static files request will
| > have much more improved performance than handling by webresource.axd.
| >
| >
| > 3. Also, putting things in APP_Code is difficult for me. I do
understand
| > what it does, but our current projects also has a lot of C# helper
files
| > (in
| > addition to aspx.cs and ascx.cs files), I understand they will need
| > explicit
| > compilation if I do not put them in the APP_code and keep them in their
| > respective directories. Will compiling the web site compile these files
| > automatically (if they are not in APP_Code directory but in normal
folders)?
| > =======================================
| > For such scenario, I think the best choice should be still separating
the
| > components/controls and helper classes in external class library so as
to
| > explictily version them or apply other assembly level attributes.
Also,
| > compile the website won't compile the code which is not in App_Code or
| > codebehind files.
| >
| >
| > 4.If I put an assembly info file in APP_Code folder, then an assembly
is
| > created in the .net temporary folder called App_Code.rnuvm4pf.dll,
which
| > picked up the assembly version correctly. However, if it is kept
outside
| > the
| > App_code, the code compiles and runs fine but the assemblyinfo is not
| > picked
| > up correctly in the dll (it always shows 0.0.0.0).
| > =======================================
| > yes, we can manually put a source code file (not necessarily named as
| > "AssemblyInfo") and put [assembly:XXX(...)] attributes in it so as to
| > embeded in the dynamic generated assemblies. However, the dynamic
| > compilation of the source code in App_Code do not gurantee that the
file
| > which contains those assembly level attributes will be compiled into a
| > fixed assembly ( e.g. always together with other source files in the
| > App_Code). In other words, the source code files in the App_code
folder
| > maybe dynamically compiled into multi assemblies, and we can not make
sure
| > which assembly actually contains the assembly version info.
| >
| > 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: asp.net assembly best practices question...
| > | thread-index: AcXaZeTkcv8kMaHPQSyHovYFJeJngA==
| > | X-WBNR-Posting-Host: 66.32.181.251
| > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | References: <97**********************************@microsoft.co m>
| > <Q#**************@TK2MSFTNGXA01.phx.gbl>
| > <5F**********************************@microsoft.co m>
| > <ld********************************@4ax.com>
| > <ED**********************************@microsoft.co m>
| > | Subject: Re: asp.net assembly best practices question...
| > | Date: Wed, 26 Oct 2005 12:46:01 -0700
| > | Lines: 82
| > | Message-ID: <3B**********************************@microsoft.co m>
| > | 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.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:134088
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Okay I found another thing which looks interesting.
| > |
| > | If I put an assembly info file in APP_Code folder, then an assembly
is
| > | created in the .net temporary folder called App_Code.rnuvm4pf.dll,
which
| > | picked up the assembly version correctly. However, if it is kept
outside
| > the
| > | App_code, the code compiles and runs fine but the assemblyinfo is not
| > picked
| > | up correctly in the dll (it always shows 0.0.0.0).
| > |
| > | Thanks
| > | --
| > | -jojobar
| > |
| > |
| > | "jojobar" wrote:
| > |
| > | > Hello Scott,
| > | >
| > | > Thanks for replying. I read in scottgu's blog that MS is trying to
| > combine
| > | > the assemblies in folders in a website. That will be great!
| > | >
| > | > From your reply I gather that if I have xxx.aspx, xxx.aspx.cs and
| > support.cs
| > | > (where support.cs only has support functions for the xxx.aspx.cs)
in a
| > folder
| > | > and compile the web site, it will not compile it correctly.
However, if
| > I
| > | > copy support.cs in APP_Code it will!
| > | >
| > | > I have not tested it yet, but my understanding was that putting in
| > APP_Code
| > | > will compile it automatically, but you still have an option to
compile
| > it
| > | > yourself elsewhere (in the web site) if you want to. Putting things
in
| > | > APP_Code is not a big deal, but I am trying to find if this is
forced
| > or an
| > | > option.
| > | >
| > | > Also, I was wondering how to put the .js files into assembly (using
| > .axd) in
| > | > a web site, if there is no way to define attributes for the
assembly
| > (usually
| > | > you define this in the assemblyinfo.cs file).
| > | >
| > | > Thanks
| > | > --
| > | > -jojobar
| > | >
| > | >
| > | > "Scott Allen" wrote:
| > | >
| > | > > On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar"
<jo*****@nospam.nospam>
| > | > > wrote:
| > | > >
| > | > > >
| > | > > >1. If I cannot have assembly info, how can I version the
assemblies?
| > I
| > | > > >checked up in the .net temp directory where the assemblies are
| > created and it
| > | > > >shows the version as 0.0.0.0. Is there any way we can version
these
| > | > > >assemblies so that we can keep track of things when they go to
the
| > client
| > | > > >site?
| > | > > >
| > | > >
| > | > > I believe we will have to wait until RTM when the ASP.NET team
| > | > > provides us with a build and deployment project. One feature of
the
| > | > > tool is supposed to be a post compilation step that will merge all
| > | > > generated assemblies into a single assembly - I'm thinking this
will
| > | > > be easy to stamp with a version.
| > | > >
| > | > > >
| > | > > >3. Also, putting things in APP_Code is difficult for me. I do
| > understand
| > | > > >what it does, but our current projects also has a lot of C#
helper
| > files (in
| > | > > >addition to aspx.cs and ascx.cs files), I understand they will
need
| > explicit
| > | > > >compilation if I do not put them in the APP_code and keep them
in
| > their
| > | > > >respective directories. Will compiling the web site compile
these
| > files
| > | > > >automatically (if they are not in APP_Code directory but in
normal
| > folders)?
| > | > > >
| > | > >
| > | > >
| > | > > You have to have stand alone code files in App_Code for the
runtime to
| > | > > compile and properly reference them from the web assemblies. Just
drop
| > | > > the .cs / .vb files in App_Code, or a subdirectory of App_Code,
and
| > | > > the runtime does the rest. If you want to logically organize the
| > | > > files, you can place them in subdirs of App_Code, or into seperate
| > | > > class libraries.
| > | > >
| > | > > Make sense?
| > | > >
| > | > > --
| > | > > Scott
| > | > > http://www.OdeToCode.com/blogs/scott/
| > | > >
| > |
| >
| >
|

Nov 19 '05 #9
Thanks again for your response. I will try this project type when we get the
new release.
--
-jojobar
"Steven Cheng[MSFT]" wrote:
Thanks for your response Jojobar,

I've also consult Scott Guthrie regarding on the questions and here are
some of his comments:

===================
We are coming out with a new deployment project on November 7th (the same
day as VS 2005 launch) that should help this customer automate building
user control assemblies. It is called the "VS 2005 Web Deployment Project"
and can be added to their solution containing the web project. It provides
several build customization options. One option it supports is to set a
version string explicitly. By default, if a version string isn't set in
the tool it will be picked up by any AssemblyInfo.cs file stored in the
app_code directory of their web project.
===================

However, for components and other helper classes, I still recommend you
keep them in separate class lib projects since that'll make redistribute
and versioning controls/components only more convenient.

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: asp.net assembly best practices question...
| thread-index: AcXa+SnlZT4gjv89RRK/q10X52ZJWA==
| X-WBNR-Posting-Host: 66.32.181.251
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<Q#**************@TK2MSFTNGXA01.phx.gbl>
<5F**********************************@microsoft.co m>
<ld********************************@4ax.com>
<ED**********************************@microsoft.co m>
<3B**********************************@microsoft.co m>
<7A**************@TK2MSFTNGXA01.phx.gbl>
| Subject: Re: asp.net assembly best practices question...
| Date: Thu, 27 Oct 2005 06:20:13 -0700
| Lines: 247
| Message-ID: <07**********************************@microsoft.co m>
| 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.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134227
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I thought that another advantage of webresource.axd is it can cache the
| javascript file and automatically refresh them in the next build. Keeping
js
| files in static folder tends to cache them the first time they are used
and
| the browser keep using the cached file even when the original file is
| changed(unless you change the file name ofcourse or clear the cache). I
was
| trying to cache the js files in another c# project and use the resource
in
| the web project (using the namespace).
|
| So far no success, maybe I am doing something wrong!
|
| >For such scenario, I think the best choice should be still separating
the
| >components/controls and helper classes in external class library so as
to
| >explictily version them or apply other assembly level attributes. Also,
| >compile the website won't compile the code which is not in App_Code or
| >codebehind files.
|
| This is a bit of restriction. but we can live with it! :-)
|
| Thanks again
| jojobar
|
| --
| -jojobar
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Thanks for your response Jojobar,
| >
| > Here are some of my understanding and suggestions regarding on the
| > questions you mentioned:
| >
| > 1. If I cannot have assembly info, how can I version the assemblies? I
| > checked up in the .net temp directory where the assemblies are created
and
| > it
| > shows the version as 0.0.0.0. Is there any way we can version these
| > assemblies so that we can keep track of things when they go to the
client
| > site?
| > =======================================
| > I'm afraid currently for the dynamic compiled assembly we can not
version
| > them as class library or other precompiled ones.
| >
| >
| > 2. I also plan to use assemblyinfo to define things so that I can embed
| > javascript files in the assembly (using webresource.axd). I figured out
how
| > to do this in assemblyinfo but do not know how to do it otherwise.
| > =======================================
| > As for embeded webresource, the ASP.NET 2.0 project dosn't quite
support
| > it, you can find that the image or other resource files in the asp.net
| > project does not contain the "Build Action" to let dynamic compilation
| > embeded them. So the [assembly:WebResource(...)] dosn't make sense in
| > asp.net 2.0 web project. Actually, this is not necessary because
dynamic
| > resource emitting is mainly target webcontrol developing, since
webcontrol
| > provider can not deliver physical files to web application developers
and
| > let them put in web dir. However, for asp.net app developing, since we
can
| > diretory manage the website's dir and files, we can just put those
static
| > resoures file in application's sub dirs so as to accessing them
directly
| > (instead of the through the webresource.axd). static files request will
| > have much more improved performance than handling by webresource.axd.
| >
| >
| > 3. Also, putting things in APP_Code is difficult for me. I do
understand
| > what it does, but our current projects also has a lot of C# helper
files
| > (in
| > addition to aspx.cs and ascx.cs files), I understand they will need
| > explicit
| > compilation if I do not put them in the APP_code and keep them in their
| > respective directories. Will compiling the web site compile these files
| > automatically (if they are not in APP_Code directory but in normal
folders)?
| > =======================================
| > For such scenario, I think the best choice should be still separating
the
| > components/controls and helper classes in external class library so as
to
| > explictily version them or apply other assembly level attributes.
Also,
| > compile the website won't compile the code which is not in App_Code or
| > codebehind files.
| >
| >
| > 4.If I put an assembly info file in APP_Code folder, then an assembly
is
| > created in the .net temporary folder called App_Code.rnuvm4pf.dll,
which
| > picked up the assembly version correctly. However, if it is kept
outside
| > the
| > App_code, the code compiles and runs fine but the assemblyinfo is not
| > picked
| > up correctly in the dll (it always shows 0.0.0.0).
| > =======================================
| > yes, we can manually put a source code file (not necessarily named as
| > "AssemblyInfo") and put [assembly:XXX(...)] attributes in it so as to
| > embeded in the dynamic generated assemblies. However, the dynamic
| > compilation of the source code in App_Code do not gurantee that the
file
| > which contains those assembly level attributes will be compiled into a
| > fixed assembly ( e.g. always together with other source files in the
| > App_Code). In other words, the source code files in the App_code
folder
| > maybe dynamically compiled into multi assemblies, and we can not make
sure
| > which assembly actually contains the assembly version info.
| >
| > 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: asp.net assembly best practices question...
| > | thread-index: AcXaZeTkcv8kMaHPQSyHovYFJeJngA==
| > | X-WBNR-Posting-Host: 66.32.181.251
| > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | References: <97**********************************@microsoft.co m>
| > <Q#**************@TK2MSFTNGXA01.phx.gbl>
| > <5F**********************************@microsoft.co m>
| > <ld********************************@4ax.com>
| > <ED**********************************@microsoft.co m>
| > | Subject: Re: asp.net assembly best practices question...
| > | Date: Wed, 26 Oct 2005 12:46:01 -0700
| > | Lines: 82
| > | Message-ID: <3B**********************************@microsoft.co m>
| > | 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.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:134088
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Okay I found another thing which looks interesting.
| > |
| > | If I put an assembly info file in APP_Code folder, then an assembly
is
| > | created in the .net temporary folder called App_Code.rnuvm4pf.dll,
which
| > | picked up the assembly version correctly. However, if it is kept
outside
| > the
| > | App_code, the code compiles and runs fine but the assemblyinfo is not
| > picked
| > | up correctly in the dll (it always shows 0.0.0.0).
| > |
| > | Thanks
| > | --
| > | -jojobar
| > |
| > |
| > | "jojobar" wrote:
| > |
| > | > Hello Scott,
| > | >
| > | > Thanks for replying. I read in scottgu's blog that MS is trying to
| > combine
| > | > the assemblies in folders in a website. That will be great!
| > | >
| > | > From your reply I gather that if I have xxx.aspx, xxx.aspx.cs and
| > support.cs
| > | > (where support.cs only has support functions for the xxx.aspx.cs)
in a
| > folder
| > | > and compile the web site, it will not compile it correctly.
However, if
| > I
| > | > copy support.cs in APP_Code it will!
| > | >
| > | > I have not tested it yet, but my understanding was that putting in
| > APP_Code
| > | > will compile it automatically, but you still have an option to
compile
| > it
| > | > yourself elsewhere (in the web site) if you want to. Putting things
in
| > | > APP_Code is not a big deal, but I am trying to find if this is
forced
| > or an
| > | > option.
| > | >
| > | > Also, I was wondering how to put the .js files into assembly (using
| > .axd) in
| > | > a web site, if there is no way to define attributes for the
assembly
| > (usually
| > | > you define this in the assemblyinfo.cs file).
| > | >
| > | > Thanks
| > | > --
| > | > -jojobar
| > | >
| > | >
| > | > "Scott Allen" wrote:
| > | >
| > | > > On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar"
<jo*****@nospam.nospam>
| > | > > wrote:
| > | > >

Nov 19 '05 #10
You're welcome Jojobar,

Also thank you for your choosing Microsoft and Whidbey ;-)

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: asp.net assembly best practices question...
| thread-index: AcXbZs0cV62+zC+ZQIKC5ZHKnE1BCg==
| X-WBNR-Posting-Host: 24.30.72.206
| From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| References: <97**********************************@microsoft.co m>
<Q#**************@TK2MSFTNGXA01.phx.gbl>
<5F**********************************@microsoft.co m>
<ld********************************@4ax.com>
<ED**********************************@microsoft.co m>
<3B**********************************@microsoft.co m>
<7A**************@TK2MSFTNGXA01.phx.gbl>
<07**********************************@microsoft.co m>
<Ft**************@TK2MSFTNGXA01.phx.gbl>
| Subject: Re: asp.net assembly best practices question...
| Date: Thu, 27 Oct 2005 19:25:02 -0700
| Lines: 308
| Message-ID: <0C**********************************@microsoft.co m>
| 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.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:134445
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks again for your response. I will try this project type when we get
the
| new release.
| --
| -jojobar
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Thanks for your response Jojobar,
| >
| > I've also consult Scott Guthrie regarding on the questions and here are
| > some of his comments:
| >
| > ===================
| > We are coming out with a new deployment project on November 7th (the
same
| > day as VS 2005 launch) that should help this customer automate building
| > user control assemblies. It is called the "VS 2005 Web Deployment
Project"
| > and can be added to their solution containing the web project. It
provides
| > several build customization options. One option it supports is to set
a
| > version string explicitly. By default, if a version string isn't set
in
| > the tool it will be picked up by any AssemblyInfo.cs file stored in the
| > app_code directory of their web project.
| > ===================
| >
| > However, for components and other helper classes, I still recommend you

| > keep them in separate class lib projects since that'll make
redistribute
| > and versioning controls/components only more convenient.
| >
| > 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: asp.net assembly best practices question...
| > | thread-index: AcXa+SnlZT4gjv89RRK/q10X52ZJWA==
| > | X-WBNR-Posting-Host: 66.32.181.251
| > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | References: <97**********************************@microsoft.co m>
| > <Q#**************@TK2MSFTNGXA01.phx.gbl>
| > <5F**********************************@microsoft.co m>
| > <ld********************************@4ax.com>
| > <ED**********************************@microsoft.co m>
| > <3B**********************************@microsoft.co m>
| > <7A**************@TK2MSFTNGXA01.phx.gbl>
| > | Subject: Re: asp.net assembly best practices question...
| > | Date: Thu, 27 Oct 2005 06:20:13 -0700
| > | Lines: 247
| > | Message-ID: <07**********************************@microsoft.co m>
| > | 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.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:134227
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I thought that another advantage of webresource.axd is it can cache
the
| > | javascript file and automatically refresh them in the next build.
Keeping
| > js
| > | files in static folder tends to cache them the first time they are
used
| > and
| > | the browser keep using the cached file even when the original file is
| > | changed(unless you change the file name ofcourse or clear the cache).
I
| > was
| > | trying to cache the js files in another c# project and use the
resource
| > in
| > | the web project (using the namespace).
| > |
| > | So far no success, maybe I am doing something wrong!
| > |
| > | >For such scenario, I think the best choice should be still
separating
| > the
| > | >components/controls and helper classes in external class library so
as
| > to
| > | >explictily version them or apply other assembly level attributes.
Also,
| > | >compile the website won't compile the code which is not in App_Code
or
| > | >codebehind files.
| > |
| > | This is a bit of restriction. but we can live with it! :-)
| > |
| > | Thanks again
| > | jojobar
| > |
| > | --
| > | -jojobar
| > |
| > |
| > | "Steven Cheng[MSFT]" wrote:
| > |
| > | > Thanks for your response Jojobar,
| > | >
| > | > Here are some of my understanding and suggestions regarding on the
| > | > questions you mentioned:
| > | >
| > | > 1. If I cannot have assembly info, how can I version the
assemblies? I
| > | > checked up in the .net temp directory where the assemblies are
created
| > and
| > | > it
| > | > shows the version as 0.0.0.0. Is there any way we can version these
| > | > assemblies so that we can keep track of things when they go to the
| > client
| > | > site?
| > | > =======================================
| > | > I'm afraid currently for the dynamic compiled assembly we can not
| > version
| > | > them as class library or other precompiled ones.
| > | >
| > | >
| > | > 2. I also plan to use assemblyinfo to define things so that I can
embed
| > | > javascript files in the assembly (using webresource.axd). I figured
out
| > how
| > | > to do this in assemblyinfo but do not know how to do it otherwise.
| > | > =======================================
| > | > As for embeded webresource, the ASP.NET 2.0 project dosn't quite
| > support
| > | > it, you can find that the image or other resource files in the
asp.net
| > | > project does not contain the "Build Action" to let dynamic
compilation
| > | > embeded them. So the [assembly:WebResource(...)] dosn't make sense
in
| > | > asp.net 2.0 web project. Actually, this is not necessary because
| > dynamic
| > | > resource emitting is mainly target webcontrol developing, since
| > webcontrol
| > | > provider can not deliver physical files to web application
developers
| > and
| > | > let them put in web dir. However, for asp.net app developing, since
we
| > can
| > | > diretory manage the website's dir and files, we can just put those
| > static
| > | > resoures file in application's sub dirs so as to accessing them
| > directly
| > | > (instead of the through the webresource.axd). static files request
will
| > | > have much more improved performance than handling by
webresource.axd.
| > | >
| > | >
| > | > 3. Also, putting things in APP_Code is difficult for me. I do
| > understand
| > | > what it does, but our current projects also has a lot of C# helper
| > files
| > | > (in
| > | > addition to aspx.cs and ascx.cs files), I understand they will need
| > | > explicit
| > | > compilation if I do not put them in the APP_code and keep them in
their
| > | > respective directories. Will compiling the web site compile these
files
| > | > automatically (if they are not in APP_Code directory but in normal
| > folders)?
| > | > =======================================
| > | > For such scenario, I think the best choice should be still
separating
| > the
| > | > components/controls and helper classes in external class library so
as
| > to
| > | > explictily version them or apply other assembly level attributes.
| > Also,
| > | > compile the website won't compile the code which is not in App_Code
or
| > | > codebehind files.
| > | >
| > | >
| > | > 4.If I put an assembly info file in APP_Code folder, then an
assembly
| > is
| > | > created in the .net temporary folder called App_Code.rnuvm4pf.dll,
| > which
| > | > picked up the assembly version correctly. However, if it is kept
| > outside
| > | > the
| > | > App_code, the code compiles and runs fine but the assemblyinfo is
not
| > | > picked
| > | > up correctly in the dll (it always shows 0.0.0.0).
| > | > =======================================
| > | > yes, we can manually put a source code file (not necessarily named
as
| > | > "AssemblyInfo") and put [assembly:XXX(...)] attributes in it so as
to
| > | > embeded in the dynamic generated assemblies. However, the dynamic
| > | > compilation of the source code in App_Code do not gurantee that the
| > file
| > | > which contains those assembly level attributes will be compiled
into a
| > | > fixed assembly ( e.g. always together with other source files in
the
| > | > App_Code). In other words, the source code files in the App_code
| > folder
| > | > maybe dynamically compiled into multi assemblies, and we can not
make
| > sure
| > | > which assembly actually contains the assembly version info.
| > | >
| > | > 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: asp.net assembly best practices question...
| > | > | thread-index: AcXaZeTkcv8kMaHPQSyHovYFJeJngA==
| > | > | X-WBNR-Posting-Host: 66.32.181.251
| > | > | From: "=?Utf-8?B?am9qb2Jhcg==?=" <jo*****@nospam.nospam>
| > | > | References: <97**********************************@microsoft.co m>
| > | > <Q#**************@TK2MSFTNGXA01.phx.gbl>
| > | > <5F**********************************@microsoft.co m>
| > | > <ld********************************@4ax.com>
| > | > <ED**********************************@microsoft.co m>
| > | > | Subject: Re: asp.net assembly best practices question...
| > | > | Date: Wed, 26 Oct 2005 12:46:01 -0700
| > | > | Lines: 82
| > | > | Message-ID: <3B**********************************@microsoft.co m>
| > | > | 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.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA01.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:134088
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | Okay I found another thing which looks interesting.
| > | > |
| > | > | If I put an assembly info file in APP_Code folder, then an
assembly
| > is
| > | > | created in the .net temporary folder called
App_Code.rnuvm4pf.dll,
| > which
| > | > | picked up the assembly version correctly. However, if it is kept
| > outside
| > | > the
| > | > | App_code, the code compiles and runs fine but the assemblyinfo is
not
| > | > picked
| > | > | up correctly in the dll (it always shows 0.0.0.0).
| > | > |
| > | > | Thanks
| > | > | --
| > | > | -jojobar
| > | > |
| > | > |
| > | > | "jojobar" wrote:
| > | > |
| > | > | > Hello Scott,
| > | > | >
| > | > | > Thanks for replying. I read in scottgu's blog that MS is trying
to
| > | > combine
| > | > | > the assemblies in folders in a website. That will be great!
| > | > | >
| > | > | > From your reply I gather that if I have xxx.aspx, xxx.aspx.cs
and
| > | > support.cs
| > | > | > (where support.cs only has support functions for the
xxx.aspx.cs)
| > in a
| > | > folder
| > | > | > and compile the web site, it will not compile it correctly.
| > However, if
| > | > I
| > | > | > copy support.cs in APP_Code it will!
| > | > | >
| > | > | > I have not tested it yet, but my understanding was that putting
in
| > | > APP_Code
| > | > | > will compile it automatically, but you still have an option to
| > compile
| > | > it
| > | > | > yourself elsewhere (in the web site) if you want to. Putting
things
| > in
| > | > | > APP_Code is not a big deal, but I am trying to find if this is
| > forced
| > | > or an
| > | > | > option.
| > | > | >
| > | > | > Also, I was wondering how to put the .js files into assembly
(using
| > | > .axd) in
| > | > | > a web site, if there is no way to define attributes for the
| > assembly
| > | > (usually
| > | > | > you define this in the assemblyinfo.cs file).
| > | > | >
| > | > | > Thanks
| > | > | > --
| > | > | > -jojobar
| > | > | >
| > | > | >
| > | > | > "Scott Allen" wrote:
| > | > | >
| > | > | > > On Wed, 26 Oct 2005 06:51:04 -0700, "jojobar"
| > <jo*****@nospam.nospam>
| > | > | > > wrote:
| > | > | > >
|

Nov 19 '05 #11

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

Similar topics

4
by: Robert Zurer | last post by:
I notice that Microsoft puts their interfaces and classes in the same assembly. For example System.Data contains OleDbConnection and IDbConnection etc. I have found it useful to keep my...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
2
by: Donal McWeeney | last post by:
Hi, Are there any good guidance white papers out there on the best way to design and build assemblys in VS.Net that would cover the following questions I have and requirements I know of: The...
13
by: john doe | last post by:
A quick question, about so-called 'best practices', I'm interested in which of A/B of the two examples people would choose, and why. public enum MyEnum { Option1 = 0, Option2 = 1, Option3 =...
1
by: Vincent V | last post by:
Hey i am just starting a new project and from the start i want to make sure my app is as Object Orientated as possible I have a couple of questions in relation to this Question 1: Should i...
10
by: Ren | last post by:
Hi All, I'm still rather new at vb.net and would like to know the proper way to access private varibables in a class. Do I access the variable directly or do I use the public property? ...
2
by: CK | last post by:
Good Morning All, What the best way to use references? Reference a project in another project or reference a DLL. We are developing C# Sharp Web Apps in VS 2003. We are getting warnings like the...
0
by: kanaille11 | last post by:
Hi, at the moment we have very strange problems with assembly directories: Following is the main structure of our project: - An ActiveX-control in "d:\TheProject\bin\debug" which is developed...
0
by: =?Utf-8?B?Sm9iIExvdA==?= | last post by:
I have created Exception Handling Policy that shows a custom error message using Custom Handler and logs it to event log using Logging Handler. I am using this policy in various layers of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.