Description
When adding this package to a project trough the NuGet package manager, the csproj is also modified with a build task to copy the tools to the $(ProjectDir\bin\roslyn)
folder. If the solution contains a lot of projects (e.g. in our case Orchard CMS has 85 out of the box and most of them require this for Razor IntelliSense and view compilation to support C# 6 and above), then copying the tools the each of them increases the size of the build folder by over 1GB (and it's also a lot of I/O). This can also affect deployment, since these files should be available runtime for the JITter.
Adding a custom parameter (e.g. compilerPath
) to override the wired-in (or the global) compiler path would enable the ability to copy the compiler files to only one of the projects (e.g. the web project) and the other ones could reference that, for example like this:
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform" warningLevel="4" compilerOptions="/langversion:6 /compilerPath:..\..\bin\roslyn"/>