共享社区互联网资源共享社区.NET源码共享 .NET框架库(.Net Framework ) 开源了

   
1  /  1  页   1 跳转 查看:2117

.NET框架库(.Net Framework ) 开源了

.NET框架库(.Net Framework ) 开源了

【原文地址】.NET Framework Library Source Code now available
【原文发表日期】 Wednesday, January 16, 2008 2:50 PM
去年十月份我发表了关于公布.NET框架库源代码和在Visual Studio 2008中启用对其调试支持的计划的一篇博客。今天我很高兴地宣布,现在可以启用源码支持了!具体来说,你现在可以查看和调试下面的.NET框架库的源代码:
  • .NET基类库(包括 System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading等)
  • ASP.NET (System.Web, System.Web.Extensions)
  • Windows Forms (System.Windows.Forms)
  • Windows Presentation Foundation (System.Windows)
  • ADO.NET and XML (System.Data 和 System.Xml)
我们正在向上面的类库列表中添加其他的框架库(包括LINQ, WCF和Workflow)过程之中。在接下来的几周或者几个月之内,当它们可用之后我会写博客告诉大家。
在Visual Studio 2008中启用参考源代码访问在Visual Studio 2008中启用.NET框架库源代码访问只要几分钟就可以配置完成。Shawn Burke在这里有一篇很详细的博客,说明了如何启用源码支持的具体步骤。
如果你在配置时遇到了麻烦或者有问题的话,请在MSDN这里Reference Source Forum论坛提问。
调试进入.NET框架库源代码在按Shawn上面的博客中的步骤配置完成之后,你就可以动态地加载.NET框架库的调试符号并且调试进入到源码之中。在你调试框架库代码的过程中,VS 2008将会从MSDN源码服务器上按需下载符号和源码文件:

开发者的注释也包括在源文件中。在上面的例子中,你可以看到Control基类中的Dispose方法的注释例子。
有时,你会看到一些注释引用了我们的缺陷/工作项跟踪数据库(bug/work-item tracking database)中以前的缺陷跟踪号码,这些号码提供了关于某个特定编码决定的额外历史信息。例如,上面的注释指出,某个特定的成员变量,为保持与框架的一个老版本的向后兼容性,不该设置成null,并且指出了因此而修正的一个向后兼容性缺陷。
参考许可(Reference License).NET框架源码是在一个只读参考许可(read-only reference license)下发布的。去年十月份我们宣布将要公布源码的时候,一些人对他们查看源码的的潜在影响有些顾虑。为了澄清和对这些顾虑作一个说明,我们对许可作了一个小小的改动,特别指出这个许可不适用于在拥有和.NET框架“相同或者本质上相同的特性或者功能(the same or substantially the same features or functionality)”的非Windows平台下开发软件的开发者。如果你开发的软件是针对Windows平台的,那么你就可以查看这些源码,即使那些软件拥有和.NET框架“相同或者本质上相同的特性或者功能”。
结语我们认为,提供源码访问和.NET框架库的调试集成对.NET开发者来说是非常有价值的。能够单步调试和查看源码对.NET框架库是如何实现的应该会提供一个更好的认识,然后使你开发出更好的应用程序,更好地应用.NET框架。
希望这些对你有所帮助,
Scott


本文英文原文:
.NET Framework Library Source Code now available Last October I blogged about our plan to release the source code to the .NET Framework libraries, and enable debugging support of them with Visual Studio 2008.  Today I'm happy to announce that this is now available for everyone to use. Specifically, you can now browse and debug the source code for the following .NET Framework libraries:
  • .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc).
  • ASP.NET (System.Web, System.Web.Extensions)
  • Windows Forms (System.Windows.Forms)
  • Windows Presentation Foundation (System.Windows)
  • ADO.NET and XML (System.Data and System.Xml)
We are in the process of adding additional framework libraries (including LINQ, WCF and Workflow) to the above list. I'll blog details on them as they become available in the weeks and months ahead.
Enabling Reference Source Access in Visual Studio 2008Enabling .NET Framework source access within Visual Studio 2008 only takes a few minutes to setup. Shawn Burke has a detailed blog post that covers the exact steps on how to enable this in more depth here.
If you run into problems or have questions setting it up, please post a question in the Reference Source Forum on MSDN here.
Stepping into .NET Framework Library SourceOnce you follow the configuration steps in Shawn’s post above, you’ll be able to dynamically load the debug symbols for .NET Framework libraries and step into the source code. VS 2008 will download both the symbols and source files on demand from the MSDN reference servers as you debug throughout the framework code:

Developer comments are included in the source files. Above you can see an example of one in the Dispose method for the Control base class.
Sometimes you'll see comments that reference a past bug/tracking number in our bug/work-item tracking database that provides additional history about a particular code decision. For example, the comment above calls out that a particular field shouldn't be nulled to maintain backwards compatibility with an older release of the framework, and points to a backwards compatibility bug that was fixed because of this.
Reference LicenseThe .NET Framework source is being released under a read-only reference license. When we announced that we were releasing the source back in October, some people had concerns about the potential impact of their viewing the source. To help clarify and address these concerns, we made a small change to the license to specifically call out that the license does not apply to users developing software for a non-Windows platform that has “the same or substantially the same features or functionality” as the .NET Framework. If the software you are developing is for Windows platforms, you can look at the code, even if that software has "the same or substantially the same features or functionality" as the .NET Framework.
SummaryWe think that enabling source code access and debugger integration of the .NET Framework libraries is going to be really valuable for .NET developers. Being able to step through and review the source should provide much better insight into how the .NET Framework libraries are implemented, and in turn enable you to build better applications and make even better use of them.
Hope this helps,
Scott

相关文章

Releasing the Source Code for the .NET Framework Libraries


One of the things my team has been working to enable has been the ability for .NET developers to download and browse the source code of the .NET Framework libraries, and to easily enable debugging support in them.
Today I'm excited to announce that we'll be providing this with the .NET 3.5 and VS 2008 release later this year.
We'll begin by offering the source code (with source file comments included) for the .NET Base Class Libraries (System, System.IO, System.Collections, System.Configuration, System.Threading, System.Net, System.Security, System.Runtime, System.Text, etc), ASP.NET (System.Web), Windows Forms (System.Windows.Forms), ADO.NET (System.Data), XML (System.Xml), and WPF (System.Windows).  We'll then be adding more libraries in the months ahead (including WCF, Workflow, and LINQ).  The source code will be released under the Microsoft Reference License (MS-RL).
You'll be able to download the .NET Framework source libraries via a standalone install (allowing you to use any text editor to browse it locally).  We will also provide integrated debugging support of it within VS 2008.
Integrated Visual Studio 2008 Debugging SupportThe final release of VS 2008 will support the ability to configure the debugger to dynamically download the .NET Framework debugger symbols (and corresponding source code) from a web server hosted by Microsoft.  You'll be able to configure the .NET Framework symbols to be downloaded all in one shot, or manually retrieved on demand:

When you debug a .NET application and hit a breakpoint in your code, you'll now be able to see a debugger call stack that contains detailed file and line number information for the .NET Framework classes and methods in your application:

In the screen-shot above, you can see that we've set a debugger breakpoint in my page where we are calling GridView1.DataBind().  Previously there was no way to drill into this DataBind() method to see how it was implemented. 
Now with VS 2008 you'll be able to press F11 ("Step Into") and drill into the .NET Framework source implementation with the debugger:

VS 2008 will include support to automatically retrieve the appropriate .NET Framework source files on demand from Microsoft.  This means that the source code for the ASP.NET GridView and BaseDataBoundControl classes above do not have to already be installed on the machine before we started the debugger.  Instead, when we use F11 to step into their implementation VS can automatically download the source files from Microsoft and open it within the IDE.
By downloading the files dynamically we can also ensure that the matching source files always line-up with the particular version of the .NET Framework on your machine (for example: if you have a GDR or Service Pack Patch installed on your machine, we'll make sure to download the source file that corresponds to it).
In addition to stepping into .NET Framework code, we can also step back up on the call stack into .NET Framework source as well.  For example, in our scenario above I could also double click up the callstack and review the private ProcessRequest method on the System.Web.UI.Page class:

We could optionally also step further up and into the System.Threading.ThreadPool implementation in mscorlib (which controls the thread our Page is scheduled on):

Note in the previous two screen-shots how the VS debugger's "Locals" and "Watch" windows are fully supported within both your code as well as in the .NET Framework source.
SummaryHaving source code access and debugger integration of the .NET Framework libraries is going to be really valuable for .NET developers.  Being able to step through and review the source should provide much better insight into how the .NET Framework libraries are implemented, and in turn enable developers to build better applications and make even better use of them.
To learn more about our source release plans and how the above debugger integration works, please check out this Podcast that Scott Hanselman and Shawn Burke recently recorded.  Shawn (who drove the source project on my team) is also going to be publishing a cool Channel9 video later this week that shows using the VS 2008 integrated debugging support with it.
Hope this helps,
Scott


本文摘自:Scott Guthrie 中英文博客

 

回复:.NET框架库(.Net Framework ) 开源了

学习
 
1  /  1  页   1 跳转

版权所有 老猫的理想   Sitemap

Powered by Discuz!NT 2.1.202    Copyright © 2001-2008 Comsenz Inc.
Processed in 0.046875 second(s) , 3 queries. 冀ICP备05001409号
返顶部