Commits

davidebbo committed 084eb49

1.3.2: ignore assemblies we can't load

Comments (0)

Files changed (3)

WebActivator/ActivationManager.cs

 namespace WebActivator {
     public class ActivationManager {
         private static bool hasInited;
-        private static IEnumerable<Assembly> _assemblies;
+        private static List<Assembly> _assemblies;
 
         public static void Run() {
             if (!hasInited) {
             get {
                 if (_assemblies == null) {
                     // Cache the list of relevant assemblies, since we need it for both Pre and Post
-                    _assemblies = GetAssemblyFiles().Select(file => Assembly.LoadFrom(file)).ToList();
+                    _assemblies = new List<Assembly>();
+                    foreach (var assemblyFile in GetAssemblyFiles()) {
+                        try {
+                            // Ignore assemblies we can't load. They could be native, etc...
+                            _assemblies.Add(Assembly.LoadFrom(assemblyFile));
+                        }
+                        catch {
+                        }
+                    }
                 }
 
                 return _assemblies;

WebActivator/Properties/AssemblyInfo.cs

 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.3.1.0")]
+[assembly: AssemblyVersion("1.3.2.0")]
 
 [assembly: PreApplicationStartMethod(typeof(WebActivator.ActivationManager), "Run")]

WebActivator/WebActivator.nuspec

 <package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
     <id>WebActivator</id>
-    <version>1.3.1</version>
+    <version>1.3.2</version>
     <authors>David Ebbo</authors>
     <owners>David Ebbo</owners>
     <requireLicenseAcceptance>false</requireLicenseAcceptance>