adoconnection / RazorEngineCore

.NET6 Razor Template Engine
MIT License
565 stars 84 forks source link

dotnet6 single file #94

Closed jddj007-hydra closed 2 years ago

jddj007-hydra commented 2 years ago

when i publish a single file on .net6 Complie method get this errors:

Empty path name is not legal. (Parameter 'path') at System.IO.Strategies.FileStreamHelpers.ValidateArguments(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Roslyn.Utilities.StandardFileSystem.OpenFile(String filePath, FileMode mode, FileAccess access, FileShare share) at Roslyn.Utilities.CommonCompilerFileSystemExtensions.OpenFileWithNormalizedException(ICommonCompilerFileSystem fileSystem, String filePath, FileMode fileMode, FileAccess fileAccess, FileShare fileShare) at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation) at RazorEngineCore.RazorEngine.<>c.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)

jddj007-hydra commented 2 years ago

look this :https://github.com/dotnet/aspnetcore/issues/38493

adoconnection commented 2 years ago

does it work with net5?

adoconnection commented 2 years ago

probably https://github.com/adoconnection/RazorEngineCore/commit/097a1c3f341f86241a85b9986cc4e68e0724c7b8#diff-9b40affa6fb42b4acc645668f9fc81bb994aa69a30a834bf5220e35a925e0c08

jddj007-hydra commented 2 years ago

it work with net6 now. thank you.