locked
How to run Razor engine in .NET Core app for custom rendering of CSHTML? RRS feed

  • Question

  • User1993186009 posted

    Hi,

    In my Core 3.1 app I am trying to get an Html from Razor template. For doing this I use the following template:

    @using RazorAndCore
    @using Microsoft.AspNetCore.Mvc
    @using Microsoft.AspNetCore.Mvc.Rendering
    @using Microsoft.AspNetCore.Mvc.ViewEngines
    @using Microsoft.AspNetCore.Mvc.ViewFeatures
    
    
    @model RazorAndCore.ViewModels.IPInfoViewModel
    
    @{
        Layout = null;
    }
    
    <!DOCTYPE html>
    
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title>Registration</title>
    </head>
    <body>
        <p>
            <h1>Your IP address is</h1><br /> @Model.Ip
        </p>
    </body>
    </html>
    

    This template is passed to the following code:

    var model = new RazorAndCore.ViewModels.IPInfoViewModel { Ip = "8.8.8.8" };
                var razorContent = System.IO.File.ReadAllText("RazorDemo1.cshtml", System.Text.Encoding.UTF8);
    
                var html = Engine.Razor
                    .RunCompile(
                        razorContent,
                        Guid.NewGuid().ToString(),
                        model.GetType(),
                        model);

    But instead of Html I get an exception right at the RunCompile() method with very long list of details:

    RazorEngine.Templating.TemplateCompilationException: Errors while compiling a Template. Please try the following to solve the situation: * If the problem is about missing/invalid references or multiple defines either try to load the missing references manually (in the compiling appdomain!) or Specify your references manually by providing your own IReferenceResolver implementation. See https://antaris.github.io/RazorEngine/ReferenceResolver.html for details. Currently all references have to be available as files! * If you get 'class' does not contain a definition for 'member': try another modelType (for example 'null' to make the model dynamic). NOTE: You CANNOT use typeof(dynamic) to make the model dynamic! Or try to use static instead of anonymous/dynamic types. More details about the error:

    - error: (20, 18) The name 'model' does not exist in the current context Temporary files of the compilation can be found in (please delete the folder): C:\Users\adm\AppData\Local\Temp\RazorEngine_bqzenu5n.gkw

    The template we tried to compile is: ------------- START -----------

    @using RazorAndCore @using Microsoft.AspNetCore.Mvc @using Microsoft.AspNetCore.Mvc.Rendering @using Microsoft.AspNetCore.Mvc.ViewEngines @using Microsoft.AspNetCore.Mvc.ViewFeatures @model RazorAndCore.ViewModels.IPInfoViewModel @{ Layout = null; }

    Your IP address is
    @Model.Ip

    ------------- END ----------- The generated source code is: ------------- START ----------- // <auto-generated>#pragma warning disable 1591 namespace CompiledRazorTemplates.Dynamic { #line hidden using System.Threading.Tasks; using System; using System.Collections.Generic; using System.Linq; using Common; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.AspNetCore.Mvc.ViewFeatures; internal class RazorEngine_c8054900d0ed42258dcead228b4b4e13 : RazorEngine.Templating.TemplateBase<razorandcore.viewmodels.ipinfoviewmodel>{ #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n\r\n"); Write(model); WriteLiteral(" RazorAndCore.ViewModels.IPInfoViewModel\r\n\r\n"); Layout = null; WriteLiteral("\r\n\r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n</razorandcore.viewmodels.ipinfoviewmodel></auto-generated>

    \r\n

    Hello


    "); Write(Model.Ip); WriteLiteral("\r\n

    \r\n\r\n"); } #pragma warning restore 1998 } } #pragma warning restore 1591 ------------- END ----------- List of loaded Assemblies: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Private.CoreLib.dll Loaded Assembly: C:\Users\adm\.nuget\packages\microsoft.testplatform.testhost\16.5.0\build\netcoreapp2.1\x64\testhost.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.TestPlatform.CoreUtilities.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\netstandard.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.Tracing.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.TestPlatform.PlatformAbstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Extensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.Debug.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Collections.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.TestPlatform.CrossPlatEngine.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.TestPlatform.CommunicationUtilities.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.VisualStudio.TestPlatform.Common.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Serialization.Formatters.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Collections.Concurrent.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.TraceSource.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.Process.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ComponentModel.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Memory.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.ThreadPool.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\Microsoft.Win32.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.InteropServices.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Tasks.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.Sockets.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Overlapped.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.NameResolution.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Private.Uri.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Linq.Expressions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Numerics.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Linq.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ComponentModel.TypeConverter.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ObjectModel.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Collections.Specialized.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Drawing.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Serialization.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Data.Common.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.ReaderWriter.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Private.Xml.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ComponentModel.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.Emit.ILGeneration.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.Emit.Lightweight.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.FileSystem.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Loader.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\xunit.runner.visualstudio.dotnetcore.testadapter.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\xunit.abstractions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\xunit.runner.utility.netcoreapp10.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Thread.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Cryptography.Algorithms.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Timer.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Resources.ResourceManager.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.InteropServices.RuntimeInformation.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\NuGet.Frameworks.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.XDocument.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Private.Xml.Linq.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Console.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\IntegrationTests.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\xunit.core.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiRealtor.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiReCaptcha.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiWeather.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.Abstractions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Common.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Analytics.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.Http.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\AutoMapper.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\AutoMapper.Extensions.Microsoft.DependencyInjection.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Dapper.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Dapper.FluentMap.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Dapper.Mapper.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Destructurama.Attributed.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\System.Net.Http.Formatting.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ComponentModel.EventBasedAsync.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.JsonPatch.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Options.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.Core.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.ViewFeatures.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.ObjectPool.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Html.Abstractions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Razor.Language.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.CodeAnalysis.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Collections.Immutable.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Mvc.WebApiCompatShim.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Server.Kestrel.Https.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Connections.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Http.Features.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\System.IO.Pipelines.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.Metadata.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Cryptography.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Text.Encoding.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.Compression.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ValueTuple.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.CodeAnalysis.CSharp.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Globalization.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.CodeAnalysis.Razor.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.VisualStudio.CodeCoverage.Shim.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\mscorlib.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.DotNet.PlatformAbstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.FileExtensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.Json.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.Extensions.DependencyModel.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.FileSystem.Primitives.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.FileProviders.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.FileProviders.Physical.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.FileSystemGlobbing.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.Internal.Strings.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.Internal.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Fabric.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Cryptography.X509Certificates.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.Preview.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Fabric.Management.ServiceModel.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Fabric.Strings.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.ServiceFabric.AspNetCore.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.ServiceFabric.Services.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Hosting.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Http.Abstractions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.ServiceFabric.AspNetCore.Kestrel.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.Data.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.Data.Interfaces.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.Data.Extensions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.ReliableCollection.Interop.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.ServiceFabric.Diagnostics.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.TextWriterTraceListener.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.TestPlatform.Utilities.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Newtonsoft.Json.Bson.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\RazorEngine.NetCore.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\Microsoft.CSharp.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\RestSharp.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.Requests.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.AspNetCore.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.Abstractions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Enrichers.CorrelationId.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Extensions.Hosting.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Extensions.Logging.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Formatting.Compact.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Settings.Configuration.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Sinks.AzureTableStorage.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Sinks.PeriodicBatching.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Microsoft.WindowsAzure.Storage.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Sinks.Console.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Sinks.Debug.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Serilog.Sinks.File.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\System.Configuration.ConfigurationManager.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Collections.NonGeneric.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.1\System.Data.SqlClient.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Transactions.Local.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Text.Encoding.Extensions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Text.RegularExpressions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\xunit.assert.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\xunit.execution.dotnet.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\Logging.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiAirQuality.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiAuth.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiAutocomplete.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiCalculatorSettings.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiEvictions.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiIP.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiLastViewed.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiPolitical.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiProgressiveQuotes.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiPropertyComments.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiPropertyImages.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiResScanner.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiSegment.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiShortList.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiSmartyStreets.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\WebApiUsers.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Caching.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Caching.Memory.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.Binder.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.CommandLine.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.EnvironmentVariables.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.Ini.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.KeyPerFile.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.UserSecrets.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Configuration.Xml.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.DependencyInjection.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.DependencyInjection.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Diagnostics.HealthChecks.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Hosting.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.FileProviders.Composite.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.FileProviders.Embedded.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Hosting.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Http.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Localization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Localization.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.Configuration.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Options.ConfigurationExtensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.Console.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.Debug.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.EventLog.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\System.Diagnostics.EventLog.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.EventSource.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Logging.TraceSource.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Options.DataAnnotations.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.WebEncoders.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Text.Encodings.Web.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.JSInterop.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Text.Json.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Win32.SystemEvents.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\System.Drawing.Common.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\System.Security.Cryptography.Pkcs.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Cryptography.Encoding.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\System.Security.Cryptography.Xml.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\System.Security.Permissions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\System.Windows.Extensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Antiforgery.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Authentication.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Authentication.Cookies.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Authentication.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Claims.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Authentication.Core.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Authentication.OAuth.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Authorization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Metadata.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Authorization.Policy.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Components.Authorization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Components.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Components.Forms.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Components.Server.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.SignalR.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.SignalR.Core.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.StaticFiles.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.SignalR.Common.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Components.Web.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.CookiePolicy.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Cors.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Cryptography.Internal.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Cryptography.KeyDerivation.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.DataProtection.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.DataProtection.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.DataProtection.Extensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Diagnostics.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Diagnostics.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Diagnostics.HealthChecks.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.HostFiltering.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Hosting.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Hosting.Server.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Http.Connections.Common.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Http.Connections.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.WebSockets.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Http.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.WebUtilities.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Http.Extensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.HttpOverrides.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.HttpsPolicy.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Identity.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Identity.Core.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Localization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Localization.Routing.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.ApiExplorer.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Routing.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Routing.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.Cors.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.DataAnnotations.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ComponentModel.Annotations.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.Formatters.Json.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.Formatters.Xml.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.Localization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.Razor.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Razor.Runtime.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Razor.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.RazorPages.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Mvc.TagHelpers.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.ResponseCaching.Abstractions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.ResponseCaching.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.ResponseCompression.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Rewrite.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Server.HttpSys.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Server.IIS.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Server.IISIntegration.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Server.Kestrel.Core.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.Security.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Server.Kestrel.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.Session.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.SignalR.Protocols.Json.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Net.Http.Headers.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.AspNetCore.WebSockets.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.4\Microsoft.Extensions.Identity.Stores.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\Microsoft.VisualBasic.Core.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\Microsoft.VisualBasic.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\Microsoft.Win32.Registry.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.AccessControl.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Principal.Windows.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.AppContext.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Buffers.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ComponentModel.DataAnnotations.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Configuration.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Core.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Data.DataSetExtensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Data.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.Contracts.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.DiagnosticSource.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.FileVersionInfo.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.StackTrace.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Diagnostics.Tools.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Drawing.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Dynamic.Runtime.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Globalization.Calendars.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Globalization.Extensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.Compression.Brotli.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.Compression.FileSystem.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.Compression.ZipFile.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.FileSystem.AccessControl.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.FileSystem.DriveInfo.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.FileSystem.Watcher.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.IsolatedStorage.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.MemoryMappedFiles.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.Pipes.AccessControl.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.Pipes.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Principal.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.IO.UnmanagedMemoryStream.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Linq.Parallel.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Linq.Queryable.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.HttpListener.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.Mail.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.NetworkInformation.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.Ping.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.ServicePoint.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.WebClient.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.WebHeaderCollection.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.WebProxy.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.WebSockets.Client.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Net.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Numerics.Vectors.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Numerics.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Private.DataContractSerialization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.DispatchProxy.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.Emit.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.Extensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Reflection.TypeExtensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Resources.Reader.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Resources.Writer.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.CompilerServices.Unsafe.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.CompilerServices.VisualC.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Handles.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.InteropServices.WindowsRuntime.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Intrinsics.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Serialization.Json.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Serialization.Xml.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.Serialization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.WindowsRuntime.UI.Xaml.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Runtime.WindowsRuntime.dll Loaded Assembly: C:\Windows\system32\WinMetadata\Windows.Foundation.winmd Loaded Assembly: C:\Windows\system32\WinMetadata\Windows.Storage.winmd Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Cryptography.Cng.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Cryptography.Csp.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.Cryptography.OpenSsl.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.SecureString.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Security.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ServiceModel.Web.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.ServiceProcess.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Text.Encoding.CodePages.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Channels.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Tasks.Dataflow.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Tasks.Extensions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Threading.Tasks.Parallel.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Transactions.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Web.HttpUtility.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Web.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Windows.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.Linq.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.Serialization.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.XPath.XDocument.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.XPath.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.XmlDocument.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.XmlSerializer.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Xml.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.dll Loaded Assembly: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\WindowsBase.dll Loaded Assembly: C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\bin\Debug\netcoreapp3.1\xunit.runner.reporters.netcoreapp10.dll at RazorEngine.Roslyn.CSharp.RoslynCompilerServiceBase.CompileType(TypeContext context) at RazorEngine.Templating.RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType) at RazorEngine.Templating.RazorEngineCore.Compile(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<runcompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String templateSource, String name, Type modelType, Object model, DynamicViewBag viewBag) at Common.Helpers.RazorTemplateHelper.GetPdfFromRazor(String razorContent, Object model) in C:\prj\RazorAndCore\RazoTemplateRendering\MSServices\Common\Helpers\RazorTemplateHelper.cs:line 29 at IntegrationTests.RazorTemplateHelperTests.GetPdfFromRazor_ShouldBePDF() in C:\prj\RazorAndCore\RazoTemplateRendering\IntegrationTests\RazorTemplateHelperTests.cs:line 77 </runcompile>

    How can I call Razor engine to get html in my app?

    Tuesday, June 16, 2020 10:21 PM

Answers

  • User711641945 posted

    Hi Gatwick,

    Firstly,as Bruce said,RazorEngine does not support for asp.net core 3.1 now.You could use RazorEngineCore.

    Then,the cshtml file could not contain the razor code besides @Model.Ip.

    Here are the whole steps:

    1.Install  Microsoft.CodeAnalysis.Common 3.6.0 on nuget.

    2.Install RazorEngineCore on Package Manager Console:

    Install-Package RazorEngineCore
    

    3.View(Index.cshtml):

    <!DOCTYPE html>
    
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title>Registration</title>
    </head>
    <body>
        <p>
            <h1>Your IP address is</h1><br /> @Model.Ip
        </p>
    </body>
    </html>

    4.Controller:

    RazorEngine razorEngine = new RazorEngine();
    
    var razorContent = System.IO.File.ReadAllText("Views/Home/Index.cshtml", System.Text.Encoding.UTF8);
    var template = razorEngine.Compile<RazorEngineTemplateBase<IPInfoViewModel>>(razorContent);
    string html = template.Run(instance =>
    {
        instance.Model = new IPInfoViewModel()
        { 
            Ip = "8.8.8.8" 
        };
    });

    Reference:

    https://github.com/adoconnection/RazorEngineCore#razorenginecore

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 17, 2020 8:53 AM

All replies

  • User-474980206 posted

    the RazorEngine project does not support core 3.1. if you want to use it, fall back asp.net core 2.1 or find a replacement.

     

    Tuesday, June 16, 2020 10:31 PM
  • User1993186009 posted

    Ok, what kind of replacement can you advise?

    Wednesday, June 17, 2020 5:20 AM
  • User711641945 posted

    Hi Gatwick,

    Firstly,as Bruce said,RazorEngine does not support for asp.net core 3.1 now.You could use RazorEngineCore.

    Then,the cshtml file could not contain the razor code besides @Model.Ip.

    Here are the whole steps:

    1.Install  Microsoft.CodeAnalysis.Common 3.6.0 on nuget.

    2.Install RazorEngineCore on Package Manager Console:

    Install-Package RazorEngineCore
    

    3.View(Index.cshtml):

    <!DOCTYPE html>
    
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title>Registration</title>
    </head>
    <body>
        <p>
            <h1>Your IP address is</h1><br /> @Model.Ip
        </p>
    </body>
    </html>

    4.Controller:

    RazorEngine razorEngine = new RazorEngine();
    
    var razorContent = System.IO.File.ReadAllText("Views/Home/Index.cshtml", System.Text.Encoding.UTF8);
    var template = razorEngine.Compile<RazorEngineTemplateBase<IPInfoViewModel>>(razorContent);
    string html = template.Run(instance =>
    {
        instance.Model = new IPInfoViewModel()
        { 
            Ip = "8.8.8.8" 
        };
    });

    Reference:

    https://github.com/adoconnection/RazorEngineCore#razorenginecore

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 17, 2020 8:53 AM
  • User1993186009 posted

    Thanks, that was exactly I was looking for.

    Wednesday, June 17, 2020 12:11 PM