Skip to content

Commit 2939af6

Browse files
committed
Ignore obsolete React.JavaScriptEngine.VroomJs and React.JavaScriptEngine.ClearScriptV8 assemblies when initialising.
1 parent fe63904 commit 2939af6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/React.Core/Initializer.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
using System;
11+
using System.Collections.Generic;
1112
using System.Linq;
1213
using System.Reflection;
1314
using RegisterOptions = React.TinyIoC.TinyIoCContainer.RegisterOptions;
@@ -19,6 +20,16 @@ namespace React
1920
/// </summary>
2021
public static class Initializer
2122
{
23+
/// <summary>
24+
/// Assemblies that are ignored when finding <see cref="IAssemblyRegistration"/>
25+
/// implementations to register dependencies.
26+
/// </summary>
27+
private readonly static ISet<string> _obsoleteAssemblies = new HashSet<string>
28+
{
29+
"React.JavaScriptEngine.VroomJs",
30+
"React.JavaScriptEngine.ClearScriptV8",
31+
};
32+
2233
/// <summary>
2334
/// Intialise ReactJS.NET
2435
/// </summary>
@@ -64,9 +75,10 @@ private static bool IsReactAssembly(Assembly assembly)
6475
{
6576
var nameWithoutVersion = assembly.FullName.Split(',')[0];
6677
return
67-
nameWithoutVersion == "React" ||
78+
(nameWithoutVersion == "React" ||
6879
nameWithoutVersion.StartsWith("React.") ||
69-
nameWithoutVersion.EndsWith(".React");
80+
nameWithoutVersion.EndsWith(".React")) &&
81+
!_obsoleteAssemblies.Contains(nameWithoutVersion);
7082
}
7183

7284
/// <summary>

src/React.Sample.Owin/React.Sample.Owin.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<DefineConstants>DEBUG;TRACE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24+
<NoWarn>1607</NoWarn>
2425
</PropertyGroup>
2526
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2627
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -30,6 +31,7 @@
3031
<DefineConstants>TRACE</DefineConstants>
3132
<ErrorReport>prompt</ErrorReport>
3233
<WarningLevel>4</WarningLevel>
34+
<NoWarn>1607</NoWarn>
3335
</PropertyGroup>
3436
<ItemGroup>
3537
<Reference Include="Microsoft.Owin">

0 commit comments

Comments
 (0)