Skip to content

Commit

Permalink
Merge pull request #571 from seesharper/fix-makegenerictype-for-nonru…
Browse files Browse the repository at this point in the history
…ntime-type

Use UnderlyingSystemType for MakeGenericMethod
  • Loading branch information
seesharper committed Sep 9, 2022
2 parents 58f3060 + a4acb58 commit 26aac32
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions build/build.csx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load "nuget:Dotnet.Build, 0.11.1"
#load "nuget:Dotnet.Build, 0.16.1"
#load "nuget:github-changelog, 0.1.5"
#load "nuget:dotnet-steps, 0.0.2"

Expand Down Expand Up @@ -46,8 +46,8 @@ public static void Test()
[StepDescription("Creates the NuGet packages")]
Step pack = () =>
{
// test();
// testcoverage();
test();
testcoverage();
DotNet.Pack();
NuGetUtils.CreateSourcePackage(BuildContext.RepositoryFolder, BuildContext.ProjectName, BuildContext.NuGetArtifactsFolder);
};
Expand Down
4 changes: 2 additions & 2 deletions src/LightInject.Benchmarks/LightInject.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="DryIoc" Version="5.2.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="DryIoc" Version="5.2.2" />
<PackageReference Include="Grace" Version="7.2.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="SimpleInjector" Version="5.4.0" />
Expand Down
6 changes: 3 additions & 3 deletions src/LightInject.Tests/LightInject.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="LightMock" Version="2.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.7.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xUnit.Analyzers" Version="1.0.0" />
Expand All @@ -33,7 +33,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/LightInject/LightInject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4747,7 +4747,7 @@ private void EmitLifetime(ServiceRegistration serviceRegistration, Action<IEmitt
int instanceDelegateIndex = servicesToDelegatesIndex.GetOrAdd(serviceRegistration, _ => CreateInstanceDelegateIndex(emitMethod));
PushScope(emitter);

emitter.Emit(OpCodes.Call, ScopeLoader.ValidateScopeMethod.MakeGenericMethod(serviceRegistration.ServiceType));
emitter.Emit(OpCodes.Call, ScopeLoader.ValidateScopeMethod.MakeGenericMethod(serviceRegistration.ServiceType.UnderlyingSystemType));

// Push the getinstance delegate
emitter.PushConstant(instanceDelegateIndex, typeof(GetInstanceDelegate));
Expand Down
8 changes: 3 additions & 5 deletions src/LightInject/LightInject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- <TargetFrameworks>netcoreapp3.1;netstandard2.0;netstandard1.6;netstandard1.3;net46</TargetFrameworks> -->
<TargetFrameworks>net6.0;netstandard2.0;netcoreapp3.1</TargetFrameworks>
<!-- <TargetFrameworks>netstandard2.0;netcoreapp2.0;netstandard1.6;netstandard1.3;netstandard1.1;net46;net452</TargetFrameworks> -->
<Version>6.5.1</Version>
<Version>6.5.2</Version>
<Authors>Bernhard Richter</Authors>
<PackageProjectUrl>https://www.lightinject.net</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
Expand Down Expand Up @@ -34,17 +34,16 @@
</PropertyGroup>
</When>
</Choose>

<ItemGroup>
<!-- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference> -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand All @@ -56,7 +55,6 @@
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Linq.Expressions" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net46' OR '$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'netstandard1.1' OR '$(TargetFramework)' == 'netstandard1.3' OR '$(TargetFramework)' == 'netstandard1.6'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
Expand Down

0 comments on commit 26aac32

Please sign in to comment.