在VS 2005中添加.NET参考 [英] Add .NET Reference in VS 2005

查看:49
本文介绍了在VS 2005中添加.NET参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经创建了几个我们在网站上添加到GAC的程序集

服务器。在VS2003的ASP.NET应用程序中,添加对强名称的引用

GAC''d Assembly意味着该Web应用程序将使用

GAC中的任何版本。


现在在VS 2005的ASP.NET应用程序中,添加对GAC程序集的引用

实际上会为Web添加特定于版本的引用的.config。这意味着

,我们必须在服务器上的每个网页上更改程序集引用?
应用程序?使用GAC来消除特定的次要版本是什么意思?回到DLL

地狱?

We have created several Assemblies that we add to the GAC on our web
servers. In an ASP.NET app in VS2003, Adding a reference to strong named
GAC''d Assembly meant that the web app would use whatever version was in the
GAC.

Now in an ASP.NET app in VS 2005, adding a reference to a GAC''d assembly
actually adds a version specific reference to the web.config. That means
that we would have to change the assembly reference in every single web
application on a server? What is the point of the using the GAC to
eliminate specific minor versions with this implementation? Back to DLL
hell?

推荐答案



" Kent" <柯** @ newsgroups.nospam>在消息中写道

news:uM ************* @ TK2MSFTNGP10.phx.gbl ...

"Kent" <Ke**@newsgroups.nospam> wrote in message
news:uM*************@TK2MSFTNGP10.phx.gbl...
我们已经创建了几个程序集我们在我们的网站
服务器上添加了GAC。在VS2003的ASP.NET应用程序中,添加对强名称
GAC''d Assembly的引用意味着该Web应用程序将使用GAC中的任何版本。

现在,在VS 2005的ASP.NET应用程序中,添加对GAC程序集的引用实际上会为web.config添加特定于版本的引用。这意味着我们必须在服务器上的每个Web应用程序中更改程序集引用?使用GAC来消除使用此实现的特定次要版本有什么意义?回到DLL
地狱?
We have created several Assemblies that we add to the GAC on our web
servers. In an ASP.NET app in VS2003, Adding a reference to strong named
GAC''d Assembly meant that the web app would use whatever version was in
the GAC.

Now in an ASP.NET app in VS 2005, adding a reference to a GAC''d assembly
actually adds a version specific reference to the web.config. That means
that we would have to change the assembly reference in every single web
application on a server? What is the point of the using the GAC to
eliminate specific minor versions with this implementation? Back to DLL
hell?




如果你不想要改变你的库的AssemblyVersion

到打破兼容性?您应该使用

AssemblyFileVersion跟踪构建,并且只在您希望

强制重新编译依赖程序集或允许并行版本时更改AssemblyVersion。 br />

David



Why are you changing the AssemblyVersion of your libraries if you don''t want
to break compatibility? You should keep track of builds using the
AssemblyFileVersion and only change the AssemblyVersion when you want to
force a recompile of dependant assemblies or allow side-by-side versions.

David


嗨肯特,


我同意David的观点。自1.1以来版本控制行为没有改变。如果你想要更新的程序集被认为是兼容的,你应该只需要修改构建版本或版本号。


.NET Framework教程 - 版本控制组件
http://msdn.microsoft.com/library/de...us/cptutorials

/html/Binding_Policy.asp


如果您有任何特殊问题,请告诉我。

谢谢。


祝你好运,


张文俊

微软在线合作伙伴支持


该帖子按原样提供。没有保证,也没有授予任何权利。

Hi Kent,

I agree with David. The versioning behavior isn''t changed since 1.1. If you
want to the updated assemblies be considered as compatible, you should only
modify the build or revision number.

NET Framework Tutorials - Versioning Components
http://msdn.microsoft.com/library/de...us/cptutorials
/html/Binding_Policy.asp

Please let me know if you have any special concerns.
Thanks.

Best regards,

WenJun Zhang
Microsoft Online Partner Support

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


这不是问题。例如,在我们的Utilities

库的AssemblyInfo.cs中,我们将版本设置为[assembly:AssemblyVersion(" 1.25。*")],其中1

是确定兼容性中断的主要版本,25是不兼容性破坏增强和错误修复的修订版本

,其余的版本号是构建版本号。 Utilities库名称很强,构建了一个

安装程序,它安装在我们所有的Web服务器上。


在VS 2003中,添加一个引用添加了一个属性Copy Local,当设置为

false时会使用GACed版本的程序集。在VS 2005中,至少在
a web项目中,添加引用会在特定版本中添加一个条目,在这种情况下为
:< assemblies>< add assembly = Company.Utilities,

Version = 1.25.2090.17025,Culture = neutral,

PublicKeyToken = C3242C516E8368B7" />< / assemblies> ;.


所以现在当我制作1.25的新版本,或者修改为1.26时,我在我的网络应用程序中得到了

构建错误:

错误2无法加载文件或程序集Company.Utilities,

Version = 1.25.2090.17025,Culture = neutral,PublicKeyToken = c3242c516e8368b7''

或其中一个依赖项。系统找不到指定的文件。

c:\inetpub \wwwroot \webapp1 \Web.config 24.


VS 2003注意强大的名字,并从

GAC拉出装配...... VS 2005有什么用?似乎只要你将

引用移动到web.config,就会呈现一些GAC功能

无用。


"" WenJun Zhang [msft]"" < WJ ***** @ online.microsoft.com>在消息中写道

news:gt ************** @ TK2MSFTNGXA02.phx.gbl ...
That''s not the issue. For example, in the AssemblyInfo.cs in our Utilities
library we set the version as [assembly: AssemblyVersion("1.25.*")] where 1
is the major version determining compatibility breaks, 25 is the revision
for non-compatibility breaking enhancements and bug fixes, and the rest of
the version number is the build. The Utilities library is strong named, an
installer is built, and it is installed on all of our web servers.

In VS 2003, adding a reference added a property Copy Local, when set to
false would use the GACed version of the assembly. In VS 2005, at least in
a web project, adding a reference adds an entry to the particular version,
in this case: <assemblies><add assembly="Company.Utilities,
Version=1.25.2090.17025, Culture=neutral,
PublicKeyToken=C3242C516E8368B7"/></assemblies>.

So now when I make a new build of 1.25, or up the revision to 1.26, I get
build errors on in my web app:
Error 2 Could not load file or assembly Company.Utilities,
Version=1.25.2090.17025, Culture=neutral, PublicKeyToken=c3242c516e8368b7''
or one of its dependencies. The system cannot find the file specified.
c:\inetpub\wwwroot\webapp1\Web.config 24.

VS 2003 paid attention to the Strong Name and pulled the assembly from the
GAC... What''s up with VS 2005? Seems like as soon as you moved the
References to the web.config, you rendered some of the GAC functionality
useless.

""WenJun Zhang[msft]"" <wj*****@online.microsoft.com> wrote in message
news:gt**************@TK2MSFTNGXA02.phx.gbl...
嗨肯特,

我同意大卫的观点。自1.1以来版本控制行为没有改变。如果您希望更新的程序集被认为是兼容的,您应该只修改构建版本或修订版号。

NET Framework教程 - 版本控制组件
http ://msdn.microsoft.com/library/de...us/cptutorials
/html/Binding_Policy.asp

如果您有任何特殊问题,请告诉我。
谢谢。

致以最诚挚的问候,

张文俊
微软在线合作伙伴支持

此帖子提供按原样没有保证,也没有赋予
权利。
Hi Kent,

I agree with David. The versioning behavior isn''t changed since 1.1. If
you
want to the updated assemblies be considered as compatible, you should
only
modify the build or revision number.

NET Framework Tutorials - Versioning Components
http://msdn.microsoft.com/library/de...us/cptutorials
/html/Binding_Policy.asp

Please let me know if you have any special concerns.
Thanks.

Best regards,

WenJun Zhang
Microsoft Online Partner Support

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



这篇关于在VS 2005中添加.NET参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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