1

I tried finding the code for specific data types like float, int and bool in c# using Ilspy, but wasn't able to. Is it possible to find the specific code used for these types in c# using Ilspy or any other way?

Jaswir
  • 172
  • 11
  • https://referencesource.microsoft.com/ - it's all been open sourced. – Mike G Mar 07 '17 at 15:31
  • 1
    Look for it in [dotnetframework.org](http://www.dotnetframework.org/default.aspx/) – Pikoh Mar 07 '17 at 15:31
  • Some parts are visible in ILSpy (`GetHashCode` for example), other parts (the arithmetic operators for example) are directly supported by the processor, so they don't really have source code... – xanatos Mar 07 '17 at 15:34
  • 3
    It highly depends on what you mean by "the code". These are special types that are implemented by a mixture of common metadata (`System.Int32`), some managed code, some unmanaged code and some logic in the jitter itself. While the source for all of these is available, there is no one single place that has all the details. – Jeroen Mostert Mar 07 '17 at 15:34
  • 2
    Some other parts (like the `[...]` of `string`) are marked as `MethodImplOptions.InternalCall` and have some corresponding C++ code hidden somewhere in the links given to you by mikeTheLiar and Pikoh – xanatos Mar 07 '17 at 15:36
  • 1
    The C++ code for `MethodImplOptions.InternalCall` is [here](https://github.com/dotnet/coreclr/tree/master/src/classlibnative/bcltype) – xanatos Mar 07 '17 at 15:37

0 Answers0