This DLL is added by default in Visual Studio 2010 projects. What is this new assembly used for? It does not seem to contain much after looking at it using Reflector and Google does not seem to have much to say about it either.
Asked
Active
Viewed 5.2k times
171

Ciro Santilli OurBigBook.com
- 347,512
- 102
- 1,199
- 985

anon
- 1,713
- 2
- 10
- 4
-
https://referencesource.microsoft.com/#Microsoft.CSharp – Palec Oct 03 '18 at 21:40
2 Answers
199
It is used when/if you use the dynamic
keyword in your project. The assembly contains the C# runtime binder.
The C# compiler has essentially been extracted out into a library so that it can emit, compile and run code needed to support the dynamic
keyword. The first time you use dynamic
in your code, this assembly (as well as System.dll, System.Core.dll and System.Dynamic.dll) will get loaded into your AppDomain.

Matthew Lock
- 13,144
- 12
- 92
- 130

adrianbanks
- 81,306
- 22
- 176
- 206
-
5Would you care to speculate on why they chose to reference it by default? Should we all be using `dynamic` a lot more than we currently are (i.e. never)? – mo. Feb 28 '13 at 14:55
-
5@mo it's similar to how they automatically add `using System.Linq;` to all files. It just makes the newer language features a little more seamless. If you want to use `dynamic`, it just works with no effort on your part. – Matt Greer Sep 05 '13 at 21:44
16
Always removed it so far. No issues yet.

TomTom
- 61,059
- 10
- 88
- 148
-
14If your project doesn't use the dynamic keyword, I guess it's ok to remove the line that says `
` in the .csproj file. – Cheeso Apr 23 '11 at 17:34 -
Thanks TomTom and @Cheeso. I was trying to build a .dll (Framework set to 3.5) to use with Unity, and removing it fromthe .csproj file did the trick. – Wolfram May 20 '15 at 13:45
-
5This "answer" is more appropriate as a comment below the question. Whilst it suggests a workaround, it does not actually answer the Question of what the new assembly is for. – toonice Nov 17 '17 at 10:13