开发者

alternative way to explore .net framework source code

开发者 https://www.devze.com 2023-01-19 08:53 出处:网络
While developing with Java in Eclipse it was very handy: you can attach sources and explore core java code just like your own. In Visual Studio I know about watching at the .net source code is possibl

While developing with Java in Eclipse it was very handy: you can attach sources and explore core java code just like your own. In Visual Studio I know about watching at the .net source code is possible only when debugging (and I can't say this feature works well).

Are there any alternativ开发者_如何学运维es of exploring .net source code?


Source code of many .NET framework libraries is available for download. It is released under reference license so you can certainly browse through code.

Also refer this and this blog post about how to setup visual studio to step-in while debugging.


Using ReSharper you can do "Go to Declaration" directly from within visual studio and it will take you the actual, original source code that is not part of your solution. It works both while debugging and in normal mode. It doesn't just work for the .NET source it works for any assemblies that you have pdbs for (given that the source code is anywhere on your disk or in your network).

In conjunction with the ReflectorNavigator PowerToy "Go to Declaration" even works for assemblies that you neither have the source code nor the pdbs for. It will use reflector behind the scenes to decompile the assembly and presents you the source code directly in visual studio.

Here is an article that discusses all that.

alternative way to explore .net framework source code


you can see the source code from the tool called Reflector. Some companies obfuscate their DLLs(for security reasons) in which case Reflector will unable to show source code.


Have you tried Reflector? Might do the job.


You can look at the Mono source code.

Mono is an open source implementation of the CLR and many base class libraries.

As for the Microsoft ones - they are proprietary, so any access to them is determined by Microsoft. As you have seen, debugging is one way of doing so and some companies have signed NDAs with Microsoft that allow them to see the source (an unlikely option for any individual, unfortunately).

Having said that, some libraries are available to download (provided you agree to the EULA), as @Hemant says in his answer.

Another option (since all of the .NET library code is compiled to IL) is to use a tool like Reflector to see a disassembled version (it will not give you the original C#, but a best effort decompilation).


You should take a look at Reflector which allow you to read bytecode compiled .NET assemblies. It's a mandatory tool for any .NET developper ;)

0

精彩评论

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