Skip to content

Commit 2fec2cd

Browse files
committed
force loading of OrmLite Assembly
1 parent 1dcd9b6 commit 2fec2cd

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/ServiceStack.Razor/Compilation/CompilerServices.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Dynamic;
4+
using System.Linq;
45
using System.Reflection;
56
using System.Runtime.CompilerServices;
7+
using ServiceStack.OrmLite;
68

79
namespace ServiceStack.Razor.Compilation
810
{
@@ -22,7 +24,7 @@ public static class CompilerServices
2224
public static bool IsAnonymousType(Type type)
2325
{
2426
if (type == null)
25-
throw new ArgumentNullException("type");
27+
throw new ArgumentNullException(nameof(type));
2628

2729
return (type.IsClass
2830
&& type.IsSealed
@@ -39,7 +41,7 @@ public static bool IsAnonymousType(Type type)
3941
public static bool IsDynamicType(Type type)
4042
{
4143
if (type == null)
42-
throw new ArgumentNullException("type");
44+
throw new ArgumentNullException(nameof(type));
4345

4446
return (DynamicType.IsAssignableFrom(type)
4547
|| ExpandoType.IsAssignableFrom(type)
@@ -54,7 +56,7 @@ public static bool IsDynamicType(Type type)
5456
public static IEnumerable<ConstructorInfo> GetConstructors(Type type)
5557
{
5658
if (type == null)
57-
throw new ArgumentNullException("type");
59+
throw new ArgumentNullException(nameof(type));
5860

5961
var constructors = type
6062
.GetConstructors(BindingFlags.Public | BindingFlags.Instance);
@@ -69,7 +71,14 @@ public static IEnumerable<ConstructorInfo> GetConstructors(Type type)
6971
public static IEnumerable<Assembly> GetLoadedAssemblies()
7072
{
7173
var domain = AppDomain.CurrentDomain;
72-
return domain.GetAssemblies();
74+
var dlls = domain.GetAssemblies().ToList();
75+
76+
if (dlls.All(x => x != typeof(OrmLiteConfig).Assembly))
77+
{
78+
dlls.Add(typeof(OrmLiteConfig).Assembly);
79+
}
80+
81+
return dlls;
7382
}
7483
}
7584
}

0 commit comments

Comments
 (0)