asp.net汇编最佳实践问题... [英] asp.net assembly best practices question...

查看:66
本文介绍了asp.net汇编最佳实践问题...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在尝试使用vs.net 2005迁移最初在vs.net中的项目

2003.我开始创建一个网站,然后为网站的每个组件创建了

的文件夹。


我在某个地方读到了网站下的每个文件夹;编译在

单独汇编中。然而,我没有找到网站。创建在

vs.net 2005中创建了任何AssemblyInfo.cs文件。


如果我手动包含这样的文件,我是否能够控制程序集

这样的版本?如果没有,这样做的正确方法是什么。


我注意到任何其他类型的项目(如C#库)

确实创造了一个属性文件夹和AssemblyInfo.cs。


谢谢


-

-jojobar

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

推荐答案

您好Jojobar,


欢迎使用ASP.NET新闻组。

关于ASP.NET 2.0中汇编编译的问题,是的,

它与1.x'的风格有很大的不同。首先,不管

VS.NET 2005 IDE,asp.net 2.0都使用新的动态编译模型。在

这个模型中,每个aspx页面的代码隐藏文件和其他源代码

(组件类,xsd ....)放在App_Code代码中会自动

在运行时编译。并且程序集在asp.net临时目录中。

这就是为什么我们不再在bin中看到预编译的dll。 sub dir(所有

那些页面类和其他组件是动态编译的)。因此,我们确实没有使用assemblyInfo代码文件来指定那些动态编译的那些用于指定

的组件attrributes。此外,汇编参考信息是

放入web.config文件中。因此,在VS.NET 2005中,

ASP.NET项目不需要项目文件。这是一个很好的功能,它来自前一版本中的许多

反馈。

另外,如果你需要为某些组件指定汇编信息

class,我们可以考虑将它们从Web项目中分离出来并放入

外部类库项目并在Web应用程序/项目中引用它。

谢谢,


Steven Cheng

Microsoft Online支持


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)



-------- ------------

| Thread-Topic:asp.net汇编最佳实践问题......

| thread-index:AcXZ2wkYrEyRUnmkTaab75t1X9ftuQ ==

| X-WBNR-Posting-Host:24.30.72.206

|来自:" =?Utf-8?B?am9qb2Jhcg ==?=" < jo ***** @ nospam.nospam>

|主题:asp.net汇编最佳实践问题...

|日期:2005年10月25日星期二20:12:02 -0700

|行数:20

|消息ID:< 97 ********************************** @ microsoft.co m>

| MIME版本:1.0

|内容类型:text / plain;

| charset =" Utf-8"

|内容传输编码:7位

| X-Newsreader:适用于Windows 2000的Microsoft CDO

| Content-Class:urn:content-classes:message

|重要性:正常

|优先级:正常

| X-MimeOLE:由Microsoft MimeOLE制作V6.00.3790.0

|新闻组:microsoft.public.dotnet.framework.aspnet

| NNTP-Posting-Host:TK2MSFTNGXA03.phx.gbl 10.40.2.250

|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl

|外翻:TK2MSFTNGXA01.phx.gbl

microsoft.public.dotnet.framework.aspnet:133843

| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

|

|您好,

|

|我正在尝试使用vs.net 2005来迁移最初在vs.net中的项目

| 2003.我开始创建一个网站,然后创建文件夹

for

|网站的每个组成部分。

|

|我在某处读到了网站下的每个文件夹。编译在

|中单独组装。然而,我没有找到网站。创作

in

| vs.net 2005创建了任何AssemblyInfo.cs文件。

|

|如果我手动包含这样的文件,我是否能够控制程序集

|这种方式的版本?如果没有,这样做的正确方法是什么。

|

|然而我注意到任何其他类型的项目(如C#库)

|确实在其中创建了一个属性文件夹和AssemblyInfo.cs。

|

|谢谢

|

| -

| -jojobar

|

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
|


感谢您的回复,我有一个具体的问题:


到目前为止,我们在asp 1.1中工作,它让我使用assemblyinfo文件控制汇编版本

。这有助于我正确地版本化我们的软件

并跟踪我们所有版本的组件。


使用2.0我试图看看我是否可以制作那种跳跃到新的做事方式。我们的应用程序有很多组件,如日历,文档管理,任务等.1.1这些是不同的C#项目和

a dll是为每个人创建的,我们可以版本正确。在阅读了Scott Guthrie的博客后,我认为拥有一个web

项目并将这些组件作为单独的目录会很棒。


这些是我遇到的问题:


1.如果我无法获得装配信息,我该如何对装配进行版本化?我在创建程序集的.n​​et临时目录中检查了


将版本显示为0.0.0.0。我们有什么方法可以对这些

组件进行编辑,这样我们就可以在他们去客户的时候跟踪这些东西

网站了吗?


2.我还计划使用assemblyinfo来定义事物,以便我可以在程序集中嵌入

javascript文件(使用webresource.axd)。我想知道

如何在assemblyinfo中执行此操作,但不知道如何执行此操作。


3.此外,将内容放入APP_Code很难我。我确实理解

它做了什么,但是我们当前的项目还有很多C#帮助文件(在aspx.cs和ascx.cs文件中除了
之外),我了解如果我不将它们放在APP_code中并将它们保存在各自的目录中,它们将需要明确的

编译。编译网站会自动编译这些文件

(如果它们不在APP_Code目录中但在普通文件夹中)?


我想遵循最好的在我们的项目中实践,但我正在努力

如何避免我们的代码库(超过3000个程序文件)发生重大变化

这样做。

亲切的问候


-

-jojobar

" Steven Cheng [MSFT]"写道:
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:
嗨Jojobar,

欢迎使用ASP.NET新闻组。
关于ASP.NET 2.0中的程序集编译问题,是的,
它与1.x'的风格有很大的不同。首先,无论VS.NET 2005 IDE如何,asp.net 2.0都使用新的动态编译模型。在这个模型中,每个aspx页面的代码隐藏文件和其他源代码
(组件类,xsd ....)放在App_Code代码中将在运行时自动编译。并且程序集在asp.net临时目录中。
这就是为什么我们不再在bin中看到预编译的dll。 sub dir(所有页面类和其他组件都是动态编译的)。因此,我们没有使用assemblyInfo代码文件来为那些动态编译的那些指定asembly attrributes。此外,程序集参考信息将放入web.config文件中。因此VS.NET 2005中的ASP.NET项目需要事件没有项目文件。这是一个很好的功能,来自前一版本中的许多
反馈。
此外,如果您需要为某些组件指定程序集信息,我们可以考虑将它们从Web项目中分离出来并放入一个外部类库项目并在Web应用程序/项目中引用它。

谢谢,

Steven Cheng
微软在线支持

获得安全! www.microsoft.com/security
(此帖已提供按原样,没有任何保证,也没有赋予
权利。)


--------------------
| Thread-Topic:asp.net汇编最佳实践问题......
| thread-index:AcXZ2wkYrEyRUnmkTaab75t1X9ftuQ ==
| X-WBNR-Posting-Host:24.30.72.206
|来自:" =?Utf-8?B?am9qb2Jhcg ==?=" < jo ***** @ nospam.nospam>
|主题:asp.net汇编最佳实践问题......
|日期:2005年10月25日星期二20:12:02 -0700
|行:20
|消息ID:< 97 ********************************** @ microsoft.co m>
| MIME版本:1.0
|内容类型:text / plain;
| charset =" Utf-8"
| Content-Transfer-Encoding:7bit
| X-Newsreader:适用于Windows 2000的Microsoft CDO
| Content-Class:urn:content-classes:message
|重要性:正常
|优先级:正常
| X-MimeOLE:由Microsoft MimeOLE制作V6.00.3790.0
|新闻组:microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host:TK2MSFTNGXA03.phx.gbl 10.40.2.250
|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
|外翻:TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:133843
| X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet
|
|您好,
|
|我正在尝试使用vs.net 2005迁移最初在vs.net中的项目
| 2003.我开始创建一个网站,然后为
创建文件夹
网站的每个组成部分。
|
|我在某处读到了网站下的每个文件夹。编译在
|单独组装。然而,我没有找到网站。创作

中vs.net 2005创建了任何AssemblyInfo.cs文件。
|
|如果我手动包含这样的文件,我将能够控制程序集
|这种方式的版本?如果没有,这样做的正确方法是什么。
|
|然而,我注意到任何其他类型的项目(如C#库)
|确实在其中创建了一个属性文件夹和AssemblyInfo.cs。
|
|谢谢
|
| -
| -jojobar
|
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
|



2005年10月26日星期三06:51:04 -0700," jojobar" < jo ***** @ nospam.nospam>

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

1。如果我无法获得装配信息,我该如何对装配进行版本控制?我在创建程序集的.n​​et临时目录中进行了检查,它显示版本为0.0.0.0。我们有什么方法可以对这些
组件进行编辑,以便我们可以在他们去客户网站时跟踪事情吗?


我相信我们会有等到RTM时ASP.NET团队

工具的一个特性应该是一个后期编译步骤,它将所有

生成的程序集合并到一个程序集中 - 我想这会是

很容易盖上版本。

3。另外,把东西放在APP_Code中对我来说很难。我确实理解它做了什么,但是我们当前的项目还有很多C#帮助文件(除了aspx.cs和ascx.cs文件之外),我知道它们需要显式的
编译如果我不将它们放在APP_code中并将它们保存在各自的目录中。编译网站会自动编译这些文件(如果它们不在APP_Code目录中但在普通文件夹中)?

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)?



你必须在App_Code中拥有独立的代码文件运行时要编译并从Web程序集中正确引用它们。只需在App_Code或App_Code的子目录中删除
.cs / .vb文件,然后在运行时完成剩下的工作。

。如果你想在逻辑上组织

文件,你可以将它们放在App_Code的子目录中,或者放在单独的

类库中。


有意义吗?


-

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


这篇关于asp.net汇编最佳实践问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆