-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
This external access DLL was added to allow experimentation between compiler and the razor source generator. The external access approach was chosen because it was a proven method in other parts of the Roslyn code base and seemed like a good fit for the compiler.
After our experiences in 17.8 around ABI changes though we've discovered this is not a good fit for the compiler. The compiler does not own it's deployment, instead it's deployed / hosted by a number of applications: VS, VS Code, Workspaces, dotnet format, etc ... All of these hosts now must be aware of and ship a copy of the MS.CA.EA.RazorCompiler DLL. This DLL is not part of the core NuGet package set which means the hosts must find the correct version and keep it up to date with the compiler (version mismatches can fail due to IVT differences). This leads to a very fragile deployment model and it bit us many times during the 17.8 release cycle.
Going forward the compiler will likely use reflection or possibly [Experimental] for future experiments. In the short term though our desire is to remove this DLL from our deployments. To do this we're going to take the following measures:
17.9
- Publish the
MS.CA.EA.RazorCompilerNuPkg to nuget.org so existing hosts have a place to download the4.8.0compatible version. - Take the APIs that exist in
MS.CA.EA.RazorCompilertoday and move them into a new type inMS.CAunder the namespaceMicrosoft.CodeAnalysis.Experimental. These APIs will beinternal. - Change the
MS.CA.EA.RazorCompilerassembly to point their implementation to those methods. At this point theMS.CA.EA.RazorCompilerassembly is just a shell that redirects method calls intoMS.CA. - Change the razor source generator to use reflection to access the APIs inside of
MS.CA.EA. If those APIs do not exist then fall back to callingMS.CA.EA.RazorCompiler. This fallback is necessary for situations where the razor source generator from 17.9 is run on the 17.8 compiler.
17.10
- Delete
MS.CA.EA.RazorCompilerentirely from razor. From here on out it will use reflection to grab the experimental API. - Delete the
MS.CA.EA.RazorCompilerproject from roslyn