Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/Handlebars/Collections/ImmutableStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace HandlebarsDotNet.Collections
{
#if NET451 || NET452
[Serializable]
#endif
internal readonly struct ImmutableStack<T>
{
private readonly Node _container;
Expand Down Expand Up @@ -43,6 +46,9 @@ public ImmutableStack<T> Pop(out T value)
return new ImmutableStack<T>(parent);
}

#if NET451 || NET452
[Serializable]
#endif
private sealed class Node : IDisposable
{
private static readonly InternalObjectPool<Node, Policy> Pool = new InternalObjectPool<Node, Policy>(new Policy());
Expand Down
7 changes: 5 additions & 2 deletions source/Handlebars/Handlebars.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AssemblyName>Handlebars</AssemblyName>
<ProjectGuid>9822C7B8-7E51-42BC-9A49-72A10491B202</ProjectGuid>
<TargetFrameworks>netstandard1.3;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net451;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net451;net452;net46</TargetFrameworks>
<Version>2.0.0</Version>
<RootNamespace>HandlebarsDotNet</RootNamespace>
<SignAssembly Condition="'$(ShouldSignAssembly)' == 'true'">true</SignAssembly>
Expand All @@ -22,6 +22,9 @@
<PropertyGroup Condition="'$(TargetFramework)'=='net452'">
<DefineConstants>$(DefineConstants);NET452</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net46'">
<DefineConstants>$(DefineConstants);NET46</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<Authors>Rex Morgan</Authors>
Expand All @@ -45,7 +48,7 @@
</Content>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net451' or '$(TargetFramework)'=='net452'">
<ItemGroup Condition="'$(TargetFramework)'=='net451' or '$(TargetFramework)'=='net452' or '$(TargetFramework)'=='net46'">
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions source/Handlebars/Polyfills/AsyncLocal.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if NET451 || NET452
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Remoting.Messaging;

Expand All @@ -19,6 +20,7 @@ public T Value
set => CallContext.LogicalSetData(Slot, new Container(value));
}

[Serializable]
private class Container
{
public readonly T Value;
Expand Down