-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Microsoft.Net.Compilers dependency #6495
Comments
Sure thing! |
Hi @ronaldbarendse, We're writing to let you know that we've added the For more information about issues and states, have a look at this blog post Thanks muchly, from your friendly PR team bot :-) |
PR is created, I'm going for that |
What are the consequences when there is no compiler anymore for the Modelbuilder? |
It just uses the default compiler (from your development environment), just like it did on Umbraco 7... |
But you can use the modelbuilder on a webserver with no development environment installed. |
You can still use Models Builder, as that doesn't depend on this package (and if it did, it would require this as its own dependency anyway - Models Builder is still an external package)... Besides, to run ASP.NET websites on a webserver, you also need to install additional services and features, including the default compiler that comes with the .NET Framework: https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-modules. |
Fixed in #6501 |
@nul800sebastiaan We might need an upgrade warning/instruction for this, because it doesn't automatically remove the installed package, but effectively removes the version restriction. So after updating Umbraco to 8.4.0,
This is only an issue when upgrading Umbraco and updating this package (new projects won't have this package installed). As this package isn't required, it can be removed after upgrading: Uninstall-Package Microsoft.Net.Compilers Or the version restriction can be added to the projects <package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net472" developmentDependency="true" allowedVersions="[2.10.0,2.999999)" /> |
Yeah, I see this as one of those things that will be good for future people installing Umbraco, I had no illusions that it would magically fix existing projects without a manual step. People who really need this will surely find your comment on here. |
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. |
1 similar comment
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. |
The Umbraco 8 NuGet package includes a dependency on
Microsoft.Net.Compilers (>= 2.10.0 && < 2.999999)
:Umbraco-CMS/build/NuSpecs/UmbracoCms.nuspec
Line 33 in 178b1cc
As commented earlier (#4493 (comment)), 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...The text was updated successfully, but these errors were encountered: