Static Classes without Implementation
What do static classes without implementation mean? Like this:
Does the runtime contain implementations and resolve them dynamically at runtime? Where/How can I read the code for these functions then?
15 Replies
Where did you find this snippet?
Seems like a method stub the IDE would show without decompiling
if you go to definition on a symbol without source (and you dont have a decompiler) it would look like this
yeah
I don't see a need for a decompiler though? That source should be enough to compile a
call <method>
opcode? My guess is that the runtime picks it up then, similarly to the JVM runtime?Unless it's code you wrote, it's been compiled to a DLL
Thus, to see the full proper source code, it needs to be decompiled
this is specifically how you get
classes without implementation
they don't really have no implementation, you just can't see it because it's compiled codeThere is no need for the compiler to have DLLs if the runtime has them, that is my guess, but please link relevant resources if I'm wrong.
.NET libraries are also distributed as DLLs
Nothing in the .NET environment is distributed as raw code, it's not JS or Python
the compiler needs the DLLs to find the symbols you're trying to use in your own code
Frameworks are compiled down to DLLs, the standard library is, any Nuget package is as well
there are no header files in C#
oh, I see it in the name of the directory now, it was indeed a stub produced by a decompiler
okay I'm convinced, thanks
But still, this is from Microsoft.Extensions.Hosting, how would I go about finding the sources?
An IDE with a decompiler, or a quick search of the repo: https://github.com/dotnet/runtime
Or https://source.dot.net
this is the what you'd call the BCL?
all of the classes under all of these namespaces?
BCL is base class library, it'd be a subset of the full runtime library, IIRC
Not 100% sure, I'm not that interested into the nitty gritty
That said, yes, the aforementioned links contain everything that comes "stock" with .NET