toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.5k stars 259 forks source link

CreateAnalyzerDriver does not have an implementation #415

Closed kevinvenclovas closed 3 years ago

kevinvenclovas commented 3 years ago

Describe the bug

I used the sample code and get following error on CompileRenderStringAsync:

Method 'CreateAnalyzerDriver' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilation' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

var engine = new RazorLightEngineBuilder()
// required to have a default RazorLightProject type,
// but not required to create a template from string.
.UseEmbeddedResourcesProject(typeof(OrderCompleteEvent))
.SetOperatingAssembly(typeof(OrderCompleteEvent).Assembly)
.UseMemoryCachingProvider()
.Build();

string template = "Hello, @Model.CustomerId. Welcome to RazorLight repository";

string result = await engine.CompileRenderStringAsync("templateKey", template, c);

Can someone help me ?

Information (please complete the following information):

jzabroski commented 3 years ago

Can you please point to what sample code you used? The sample logic works in the Sandbox folder. If you're getting a dependency issue but not pasting your csproj, it's impossible to even begin debugging.

jzabroski commented 3 years ago

Updated the bug_report.md to mention this: https://github.com/toddams/RazorLight/blob/master/.github/ISSUE_TEMPLATE/bug_report.md

jzabroski commented 3 years ago

Closing due to no response. Locking as well.