Skip to content

Commit e5109e5

Browse files
committed
added test proj for #519 with the repro;
remove FEC EmitCall
1 parent c8bc6a5 commit e5109e5

File tree

10 files changed

+82
-20
lines changed

10 files changed

+82
-20
lines changed

DryIoc.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DryIoc.Microsoft.Dependency
124124
EndProject
125125
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground", "playground\Playground\Playground.csproj", "{AE6FA868-31E9-4726-9A8E-8BAB2ADD1F9D}"
126126
EndProject
127+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{38A94225-72AE-4869-88A2-61FCB48ED681}"
128+
EndProject
129+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test", "samples\GHIssue519\test.csproj", "{0CAC5A1E-FEB3-4C12-929C-AB9EF9171F73}"
130+
EndProject
127131
Global
128132
GlobalSection(SolutionConfigurationPlatforms) = preSolution
129133
Debug|Any CPU = Debug|Any CPU
@@ -258,6 +262,10 @@ Global
258262
{AE6FA868-31E9-4726-9A8E-8BAB2ADD1F9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
259263
{AE6FA868-31E9-4726-9A8E-8BAB2ADD1F9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
260264
{AE6FA868-31E9-4726-9A8E-8BAB2ADD1F9D}.Release|Any CPU.Build.0 = Release|Any CPU
265+
{0CAC5A1E-FEB3-4C12-929C-AB9EF9171F73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
266+
{0CAC5A1E-FEB3-4C12-929C-AB9EF9171F73}.Debug|Any CPU.Build.0 = Debug|Any CPU
267+
{0CAC5A1E-FEB3-4C12-929C-AB9EF9171F73}.Release|Any CPU.ActiveCfg = Release|Any CPU
268+
{0CAC5A1E-FEB3-4C12-929C-AB9EF9171F73}.Release|Any CPU.Build.0 = Release|Any CPU
261269
EndGlobalSection
262270
GlobalSection(SolutionProperties) = preSolution
263271
HideSolutionNode = FALSE
@@ -295,6 +303,7 @@ Global
295303
{400BE898-DF9C-4DE8-9483-1F43F990784B} = {258FA031-1B82-403A-B235-9A25B17A024A}
296304
{480C65D7-184D-44E7-9B5D-05E30D857977} = {69DDE71E-F688-44E9-9A60-AB0DE2D270FF}
297305
{AE6FA868-31E9-4726-9A8E-8BAB2ADD1F9D} = {85CE6F42-1A5A-4475-9E8C-D3090BCC6EED}
306+
{0CAC5A1E-FEB3-4C12-929C-AB9EF9171F73} = {38A94225-72AE-4869-88A2-61FCB48ED681}
298307
EndGlobalSection
299308
GlobalSection(ExtensibilityGlobals) = postSolution
300309
SolutionGuid = {722EDB85-282C-48BF-9384-BC9C5C230923}

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ image:
33
- Ubuntu
44
- macOS
55

6-
version: 5.2.1-build-{build}
6+
version: 5.2.2-build-{build}
77

88
test: off
99

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
3+
namespace test.Controllers;
4+
5+
public class HomeController : Controller
6+
{
7+
public IActionResult Index()
8+
{
9+
return View();
10+
}
11+
}

samples/GHIssue519/Program.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using DryIoc;
2+
using DryIoc.Microsoft.DependencyInjection;
3+
4+
var builder = WebApplication.CreateBuilder(args);
5+
var container = new Container(Rules.MicrosoftDependencyInjectionRules);
6+
var dependencyInjectionFactory = new DryIocServiceProviderFactory(container);
7+
builder.Host.UseServiceProviderFactory(dependencyInjectionFactory);
8+
builder.Services.AddControllersWithViews();
9+
builder.Services.AddWebOptimizer(options =>
10+
{
11+
options.AddLessBundle("/css/test.css", "wwwroot/css/test.less").UseContentRoot();
12+
});
13+
14+
var app = builder.Build();
15+
app.UseDeveloperExceptionPage();
16+
app.UseWebOptimizer();
17+
app.UseHttpsRedirection();
18+
app.UseStaticFiles();
19+
app.UseRouting();
20+
app.UseAuthorization();
21+
app.MapControllerRoute(
22+
name: "default",
23+
pattern: "{controller=Home}/{action=Index}/{id?}");
24+
25+
app.Run();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@{
2+
ViewData["Title"] = "Home Page";
3+
}
4+
5+
<link rel="stylesheet" href="/css/test.css"/>
6+
7+
<div class="text-center">
8+
<h1 class="display-4">Welcome</h1>
9+
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
10+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

samples/GHIssue519/test.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="codeessentials.WebOptimizer.Dotless" Version="3.1.0" />
11+
<!-- <PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.0.2" /> -->
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\..\src\DryIoc.Microsoft.DependencyInjection\DryIoc.Microsoft.DependencyInjection.csproj" />
16+
</ItemGroup>
17+
18+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background: lightcyan;
3+
}

src/DryIoc/DryIoc.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFrameworks>net45;netstandard2.0;netstandard2.1</TargetFrameworks>
44

55
<Product>DryIoc</Product>
6-
<VersionPrefix>5.2.1</VersionPrefix>
6+
<VersionPrefix>5.2.2</VersionPrefix>
77
<VersionSuffix></VersionSuffix>
88

99
<AssemblyName>$(Product)</AssemblyName>

src/DryIoc/FastExpressionCompiler.cs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ THE SOFTWARE.
2929
#if LIGHT_EXPRESSION || !NET45
3030
#define SUPPORTS_ARGUMENT_PROVIDER
3131
#endif
32-
#if !NETSTANDARD2_0
33-
#define SUPPORTS_EMITCALL
34-
#endif
3532
#if LIGHT_EXPRESSION
3633
namespace DryIoc.FastExpressionCompiler.LightExpression
3734
{
@@ -5170,39 +5167,27 @@ private static Expression TryReduceCondition(Expression testExpr)
51705167
return testExpr;
51715168
}
51725169

5173-
/// Get the advantage of the optimized specialized EmitCall method
5170+
// todo: @feature EmitCall is specifically for the varags method and not for normal conventions methods,
5171+
// for those you need to call Emit(OpCodes.Call|Callvirt, methodInfo).
5172+
// So for now the varargs methods are not supported yet.
51745173
[MethodImpl((MethodImplOptions)256)]
51755174
public static bool EmitMethodCallOrVirtualCall(ILGenerator il, MethodInfo method)
51765175
{
5177-
#if SUPPORTS_EMITCALL
5178-
il.EmitCall(method.IsVirtual ? OpCodes.Callvirt : OpCodes.Call, method, null);
5179-
#else
51805176
il.Emit(method.IsVirtual ? OpCodes.Callvirt : OpCodes.Call, method);
5181-
#endif
51825177
return true;
51835178
}
51845179

5185-
/// Get the advantage of the optimized specialized EmitCall method
51865180
[MethodImpl((MethodImplOptions)256)]
51875181
public static bool EmitVirtualMethodCall(ILGenerator il, MethodInfo method)
51885182
{
5189-
#if SUPPORTS_EMITCALL
5190-
il.EmitCall(OpCodes.Callvirt, method, null);
5191-
#else
51925183
il.Emit(OpCodes.Callvirt, method);
5193-
#endif
51945184
return true;
51955185
}
51965186

5197-
/// Get the advantage of the optimized specialized EmitCall method
51985187
[MethodImpl((MethodImplOptions)256)]
51995188
public static bool EmitMethodCall(ILGenerator il, MethodInfo method)
52005189
{
5201-
#if SUPPORTS_EMITCALL
5202-
il.EmitCall(OpCodes.Call, method, null);
5203-
#else
52045190
il.Emit(OpCodes.Call, method);
5205-
#endif
52065191
return true;
52075192
}
52085193

0 commit comments

Comments
 (0)