Skip to content
Permalink
Browse files

fix: issues with binding to library (#2272)

  • Loading branch information
glennawatson authored and RLittlesII committed Dec 5, 2019
1 parent 25522a7 commit f79c82bd99dc0f4f16e1f1cc4b4000dfaa43ceb4
Showing with 3 additions and 11 deletions.
  1. +3 −11 src/ReactiveUI/Mixins/DependencyResolverMixins.cs
@@ -46,7 +46,6 @@ public static void InitializeReactiveUI(this IMutableDependencyResolver resolver
var assemblyName = new AssemblyName(fdr.AssemblyQualifiedName.Replace(fdr.FullName + ", ", string.Empty));

extraNs
.Where(GetNamespaceExists)
.ForEach(ns => ProcessRegistrationForNamespace(ns, assemblyName, resolver));
}

@@ -109,10 +108,10 @@ private static Func<object> TypeFactory(TypeInfo typeInfo)
}

[SuppressMessage("Globalization", "CA1307: operator could change based on locale settings", Justification = "Replace() does not have third parameter on all platforms")]
private static void ProcessRegistrationForNamespace(string ns, AssemblyName assemblyName, IMutableDependencyResolver resolver)
private static void ProcessRegistrationForNamespace(string namespaceName, AssemblyName assemblyName, IMutableDependencyResolver resolver)
{
var targetType = ns + ".Registrations";
var fullName = targetType + ", " + assemblyName.FullName.Replace(assemblyName.Name, ns);
var targetType = namespaceName + ".Registrations";
var fullName = targetType + ", " + assemblyName.FullName.Replace(assemblyName.Name, namespaceName);

var registerTypeClass = Reflection.ReallyFindType(fullName, false);
if (registerTypeClass != null)
@@ -121,12 +120,5 @@ private static void ProcessRegistrationForNamespace(string ns, AssemblyName asse
registerer.Register((f, t) => resolver.RegisterConstant(f(), t));
}
}

private static bool GetNamespaceExists(string namespaceName)
{
string folderPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string assemblyPath = Path.Combine(folderPath, new AssemblyName(namespaceName).Name + ".dll");
return File.Exists(assemblyPath);
}
}
}

0 comments on commit f79c82b

Please sign in to comment.
You can’t perform that action at this time.