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.

RazorEngineCore.RazorEngine.Compile not work when publish to single file

See original GitHub issue

target framework is .net5
when i publish exe to single file ,compile a templeate ,get this error: System.ArgumentException: Empty path name is not legal. (Parameter ‘path’) at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.IO.File.OpenRead(String path) at Roslyn.Utilities.FileUtilities.OpenFileStream(String path) at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation) at RazorEngineCore.RazorEngine.<>c.<CreateAndCompileToStream>b__4_1(Assembly ass) at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at System.Collections.Generic.List1.AddRange(IEnumerable1 collection) at System.Linq.Enumerable.ConcatIterator1.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at RazorEngineCore.RazorEngine.CreateAndCompileToStream(String templateSource, RazorEngineCompilationOptions options) at RazorEngineCore.RazorEngine.Compile(String content, Action1 builderAction)

if not single file , it ok

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
adoconnectioncommented, Mar 4, 2021

Closing issue then 😃

3reactions
adoconnectioncommented, Feb 12, 2021

got the exception. apparently its a NET5 breaking change…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Razorengine "Unable to compile template. Check the ...
I'm using "Razorengine" to generate the emailbody from a cshtml template. When running the application in debug mode (VS 2010) all is working...
Read more >
adoconnection/RazorEngineCore: .NET6 Razor Template ...
NET Framework 4.7.2; Windows / Linux; Publish as single file supported; Thread safe ... you should not compile template every time you need...
Read more >
Self-Contained Single-File does not produce a single file
I have set it up to publish as a self-contained single-file. However, in the publish directory is the EXE file and four DLLs....
Read more >
Render Emails Using Razor Templating
Learn how to use different open-source Razor engines to render Razor templates to strings for sending emails.
Read more >
RazorEngine
A templating engine built on Microsoft's Razor parsing engine, RazorEngine allows you to use Razor syntax to build dynamic templates.
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