开发者

Do the assemblies in Add Reference dialog differ depending on .Net framework used?

I'm curious - does the listing of assemblies in the Add Reference dialog vary depending on the version of the .Net framework used for t开发者_如何学Pythonhe selected project. If they do differ, I'd love to know where the differences lie. Thanks!


The list of assemblies is directly tied to the .net version in use in the current project. The assemblies that cant be used are greyed out. See the section "References List Depends On .NET Framework Target" here:

http://msdn.microsoft.com/en-us/library/ftcwa60a(VS.90).aspx


This is only relevant in VS2010. There is only one version present of the .NET assemblies for .NET 2.0 through 3.5SP1. Your project will simply reference the one and only version of such an assembly. The Framework Target setting just prevents you from adding references to assemblies that are not present in the selected version.

That's very different in VS2010 since it supports .NET 4.0. That is a version that can be installed side-by-side with previous versions of .NET. Your list of assembly reference now do change if you select between .NET 4.0 and an earlier version in your Framework Target setting. It is subtle, only the Version property in the Property Grid changes.


The assemblies listed are different depending on the framework version of your Project as defined in the Properties of your project.

For instance if you define your project to use .net 3.5 you will be able to add System.Linq but if you use .net 2.0 you will not.

You can probably see what the dirrerences are in a Whats new in .net 3.5/4.0 article


Assemblies that were compiled to a later framework than you are using are not included. Also they must be .NET assemblies. If you have a C++ project in your code you can not include that dll in your references. If you want that dll in your bin you can do something like add existing item, add the dll as a link and set the copy newer property. Keep in mind though that this method does not cascade up.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜