You got the below error if you have ASP.net core 2.0 MVC application running in Windows Server 2012 R2 in IIS 8
An unhandled exception occurred while processing the request.
InvalidOperationException: Cannot find compilation library location for package 'Microsoft.Win32.Registry'
Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths(ICompilationAssemblyResolver resolver, List assemblies)
How to fix this:
Add the below line
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
to .csproj
and then please republish your site to our server.