Remove Microsoft.Net.Compilers dependency
See original GitHub issueThe Umbraco 8 NuGet package includes a dependency on Microsoft.Net.Compilers (>= 2.10.0 && < 2.999999)
: https://github.com/umbraco/Umbraco-CMS/blob/178b1ccf40aa67815be77698a259b5db31ab9013/build/NuSpecs/UmbracoCms.nuspec#L33
As commented earlier (https://github.com/umbraco/Umbraco-CMS/issues/4493#issuecomment-489080794), this is not required as Microsoft.CodeDom.Providers.DotNetCompilerPlatform (>= 2.0.0)
already includes the compiler binaries (for dynamic compilation of views): https://github.com/aspnet/RoslynCodeDomProvider#version-200.
Installing Microsoft.Net.Compilers
replaces the built-in compiler that’s used when building the project and because of the version range, it’s not possible to update this to the latest version to make use of new C# features. It’s also slower than using the compiler Visual Studio ships with and version 2.10.0 is actually the same as the minimum required VS version for local development: https://our.umbraco.com/Documentation/Getting-Started/Setup/Requirements/#local-development.
Reproduction
Bug summary
Can’t use the latest C# features, as the compiler gets replaced by an out-of-date version because it’s included as a NuGet dependency.
Workaround
It’s possible to forcefully remove the package PM> Uninstall-Package Microsoft.Net.Compilers -Force
(gives errors when updating Umbraco), remove the build-target from the project file (needs to be repeated after updating the package) or move code to a seperate library. This should however not be required…
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (9 by maintainers)
PR is created, I’m going for that
hacktoberfest/contrib-2019
label 😉This error usually comes when you upgrade the below libraries by nuget
Microsoft.CodeDom.Providers.DotNetCompilerPlatform
Microsoft.Net.Compilers
Guys, If your project is not loading due to this error. just go to that project location by explorer and delete the obj folder manually.
Then right-click on the project and RELOAD AGAIN.