Exception text:
RazorLight.RazorLightException: 'Can't load metadata reference from the entry assembly. Make sure preserveCompilationContext is set to true in buildOptions section of project.json or in *.csproj file'
Here is the solution with isolated case:
https://1drv.ms/u/s!AuXjDEud3Cas10ihf9jpraKC316w
I downloaded your project, did not change anything and it runs just fine

I've updated the example:
https://1drv.ms/u/s!AuXjDEud3Cas11GysXD1m7XJR-Sv
changing
<TargetFramework>netcoreapp1.1</TargetFramework>
to
<TargetFramework>netstandard1.6</TargetFramework>
in class lib was the key
@ossaltu, I suspect that you didn't clean the project before rebuilding and trying that again. It was an issue for myself. I've just created the PR to add this warning to README.
Add <PreserveCompilationContext>true</PreserveCompilationContext> to the csproj, worked for me!
Yes, clean rebuild seems to be working
@ossaltu and @toddams I got a same problem.
As @ForNeVeR was mentioned, is really important.
If someone is using Visual Studio Code for development, delete bin and obj folder and then dotnet restore and dotnet build the solution and after dotnet run.
Most helpful comment
Add
<PreserveCompilationContext>true</PreserveCompilationContext>to the csproj, worked for me!