question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues with .NET Standard reference on Linux starting with 2020.9.1

See original GitHub issue

After updating to version 2020.9.1, I get the following exception when rendering templates:

RazorEngineCore.RazorEngineCompilationException: Unable to compile template: (28,29): error CS0012: The type ‘Object’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. at RazorEngineCore.RazorEngine.CreateAndCompileToStream(String templateSource, RazorEngineCompilationOptions options) at RazorEngineCore.RazorEngine.Compile[T](String content, Action`1 builderAction)

This happens on Linux only (see this build), the same logic works on Windows as expected (with identical SDK versions etc.).

Do you have an idea how to overcome this issue? I tried to tweak the assembly references, but I suspect the compilation process of the template is missing some .NET Standard reference.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Kaliumhexacyanoferratcommented, Oct 12, 2020

Build with 2020.10.1 works on Windows and Linux. Thank you very much!

1reaction
adoconnectioncommented, Oct 6, 2020

Hi, thats probably due to I missed something with references on init. Will recheck it again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET Standard
NET Standard allows a library to use more APIs but means it can only be used on more recent versions of .NET. Targeting...
Read more >
NET Standard on Linux - msbuild
The console application has a dependency to the netstandard library. From Visual Studio, I am able to build the solution without any problem, ......
Read more >
Please stop lying about .NET Standard 2.0 support!
In this post I have a bit of a rant about Microsoft's NuGet packages lying about supporting .NET Standard 2.0 when they kinda...
Read more >
IronPdf 2023.8.6
IronPDF helps C# Software Engineers to create, edit and extract PDF content in .NET projects. # C# HTML to PDF for .NET 7,...
Read more >
General advice for legacy project migration to .NET ...
As the title states I have legacy project (huge), that needs to be pushed forward. I need an overall advice of how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found