1

I am trying to understand the folder structure of a corefx project, here System.IO. Here is how the System.IO folder appears in OS X

System.IO BLACKSTAR$ pwd
/Users/BLACKSTAR/dotnet/corefx/src/System.IO
sameer:System.IO BLACKSTAR$ tree
.
├── System.IO.sln
├── ref
│   ├── System.IO.Manual.cs
│   ├── System.IO.cs
│   ├── System.IO.csproj
│   ├── bin
│   │   └── Debug
│   │       └── dotnet
│   │           ├── ref.dll
│   │           └── ref.xml
│   ├── project.json
│   └── project.lock.json
├── src
│   ├── Resources
│   │   └── Strings.resx
│   ├── System
│   │   └── IO
│   │       └── InvalidDataException.cs
│   ├── System.IO.csproj
│   ├── project.json
│   └── project.lock.json

Here is what I am trying to figure out

  1. What is there in ref folder?
  2. What is there in src folder?
  3. What is the connection between ref and src?
  4. Ref is targeted to dotnet but Src is targeted to dnxcore50 framework. What does this imply?
  5. I was able to build the project in ref folder but i couldn't build the project in src using dnu build though dnu restore ran successfully. What am I doing wrong?
sameer:System.IO BLACKSTAR$ dnvm list

Active Version              Runtime Architecture OperatingSystem Alias
------ -------              ------- ------------ --------------- -----
       1.0.0-beta7          coreclr x64          darwin          
  *    1.0.0-beta7          mono                 linux/osx       default

sameer:System.IO BLACKSTAR$
Sameer
  • 3,124
  • 5
  • 30
  • 57

1 Answers1

1

What you See here is a NuGet package for a namespace which is in reality part of the CLR. Some types are needed very early... Like file io and elementary data types so they are part of the CLR distribution. You can find these in the core CLR github project.

So ...

  1. Ref are empty implementations for design time. They are there to define the types.
  2. SRC is the dnxcore5 based implementation... Essentially being empty.
  3. Ref vs SRC.... Ref is used for lookup of the types ... Binding to the implementation (either in coreclr or mscorlib) is done by some PCL type forwards.
  4. SRC is the pseudo implementation for coreclr. Maybe just the missing types. Ref targets dotnet since all modern SDK have type forwards for System.IO.
  5. I have no idea how they are build.

Sorry for the missing details. It is not very well documented by MS.

Thomas
  • 5,080
  • 27
  • 42