Handlebars-Net / Handlebars.Net.Helpers

Handlebars.Net helpers in the categories: 'Boolean', 'Constants', 'Enumerable', 'Environment', 'Math', 'Regex', 'String', 'DateTime' and 'Url'.
MIT License
38 stars 14 forks source link

System.TypeLoadException : Could not load type 'HandlebarsDotNet.Polyfills.AsyncLocal`1' from assembly 'Handlebars, Version=2.1.2.0, Culture=neutral, PublicKeyToken=22225d0bf33cd661'. #65

Closed caoko closed 1 year ago

caoko commented 1 year ago

project .net framework version 4.8

Handlebars source (net46) https://github.com/Handlebars-Net/Handlebars.Net/blob/master/source/Handlebars/Polyfills/AsyncLocal.cs

#if NET451 || NET452
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Remoting.Messaging;

namespace HandlebarsDotNet.Polyfills
{
    public sealed class AsyncLocal<T>

HandlebarsHelpers source (net452) https://github.com/Handlebars-Net/Handlebars.Net.Helpers/blob/master/src/Handlebars.Net.Helpers/HandlebarsHelpers.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using HandlebarsDotNet.Helpers.Attributes;
using HandlebarsDotNet.Helpers.Enums;
using HandlebarsDotNet.Helpers.Extensions;
using HandlebarsDotNet.Helpers.Helpers;
using HandlebarsDotNet.Helpers.Options;
using HandlebarsDotNet.Helpers.Parsers;
using HandlebarsDotNet.Helpers.Plugin;
using HandlebarsDotNet.Helpers.Utils;
using Stef.Validation;
using HandlebarsDotNet.Helpers.Models;
#if NETSTANDARD1_3_OR_GREATER
using System.Threading;
#else
using HandlebarsDotNet.Polyfills;
#endif

namespace HandlebarsDotNet.Helpers;

/// <summary>
/// Extension class to Register additional Helpers and BlockHelpers.
/// </summary>
public static class HandlebarsHelpers
{
    /// <summary>
    /// https://learn.microsoft.com/en-us/dotnet/api/system.threading.asynclocal-1
    /// </summary>
    internal static AsyncLocal<EvaluateResult> AsyncLocalResultFromEvaluate = new();
StefH commented 1 year ago

Thank you for the PR.