0

I am trying to check the namespace and the types in System.IO.Filesystem assembly by usinig ILSPY but I am not able to see any namespace at all as shown in the below img link, why am I not able to see it?

ILSPY scrshot

1

vimuth
  • 5,064
  • 33
  • 79
  • 116
Kailashh
  • 1
  • 1
  • It is a glue assembly, it powers the types declared with [assembly:TypeForwardedTo]. Just off the screen of your screenshot. Note that these file related types have a very strong operating system dependency, Unix does files very differently from Windows. A type like FileSystemEntry resolves to the declarations in FileSystemEntry.Unix.cs or FileSystemEntry.Windows.cs, depending on what flavor of the .NET runtime you run on. Compilers are oblivious to those differences, the binding occurs at runtime. So the exact same source code and compiled assembly can run on any OS. – Hans Passant Feb 05 '23 at 15:47

1 Answers1

1

The System.IO.Filesystem.dll doesn't really contain any code, it just contains links to the actual types. I don't really know why they did that, I presume for some compatibility reasons. The actual implementation of all the classes in there are in the runtime kernel assembly (System.Private.Corelib.dll).

Your version of IlSpy doesn't seem to handle this scenario correctly. Maybe there's a newer version. DotPeek shows this correctly:

System.IO.FileSystem with forwarded types

PMF
  • 14,535
  • 3
  • 23
  • 49