aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-08-28 12:41:58 -0400
committerGitHub <noreply@github.com>2017-08-28 12:41:57 -0400
commita3168a87b348f02fb3bac9f8b5928da87f10abde (patch)
tree61f2c21989ae2a2fbe89d0e0e76cdf10b7dd3714 /Emby.Server.Implementations/ApplicationHost.cs
parent2cce1a8caf946da1803c003f7d787303c4f4f54c (diff)
parent780b761456bd46fc7684a72a11afa35715f48c0b (diff)
Merge pull request #2850 from MediaBrowser/dev
3.2.29.2
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs21
1 files changed, 17 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 70ec37a3b..345445102 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -1482,13 +1482,26 @@ namespace Emby.Server.Implementations
var assembly = plugin.GetType().Assembly;
var assemblyName = assembly.GetName();
- var attribute = (GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute), true)[0];
- var assemblyId = new Guid(attribute.Value);
-
var assemblyFileName = assemblyName.Name + ".dll";
var assemblyFilePath = Path.Combine(ApplicationPaths.PluginsPath, assemblyFileName);
- assemblyPlugin.SetAttributes(assemblyFilePath, assemblyFileName, assemblyName.Version, assemblyId);
+ assemblyPlugin.SetAttributes(assemblyFilePath, assemblyFileName, assemblyName.Version);
+
+ try
+ {
+ var idAttributes = assembly.GetCustomAttributes(typeof(GuidAttribute), true);
+ if (idAttributes.Length > 0)
+ {
+ var attribute = (GuidAttribute)idAttributes[0];
+ var assemblyId = new Guid(attribute.Value);
+
+ assemblyPlugin.SetId(assemblyId);
+ }
+ }
+ catch (Exception ex)
+ {
+ Logger.ErrorException("Error getting plugin Id from {0}.", ex, plugin.GetType().FullName);
+ }
}
var isFirstRun = !File.Exists(plugin.ConfigurationFilePath);