Public Access
Fix workflow rule validation logging
PR and Push Build/Test / build-and-test (push) Failing after 9m19s
PR and Push Build/Test / build-and-test (push) Failing after 9m19s
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using RazorLight;
|
||||
|
||||
namespace MeetingAssistant.Workflow;
|
||||
|
||||
internal static class MeetingWorkflowRazorEngineFactory
|
||||
{
|
||||
public static RazorLightEngine Create()
|
||||
{
|
||||
return new RazorLightEngineBuilder()
|
||||
.UseNoProject()
|
||||
.SetOperatingAssembly(typeof(RazorLightEngine).Assembly)
|
||||
.AddMetadataReferences(CreateMetadataReferences())
|
||||
.Build();
|
||||
}
|
||||
|
||||
private static MetadataReference[] CreateMetadataReferences()
|
||||
{
|
||||
return AppDomain.CurrentDomain.GetAssemblies()
|
||||
.Where(assembly => !assembly.IsDynamic && !string.IsNullOrWhiteSpace(assembly.Location))
|
||||
.Select(assembly => assembly.Location)
|
||||
.Where(File.Exists)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Select(path => MetadataReference.CreateFromFile(path))
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user