mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -6,12 +6,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{74E681ED
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{383DBA32-4A3E-48D1-AAC3-75377A694452}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Notes", "_Notes", "{8A49DB66-40B2-4B6A-BFF0-D4839A240D00}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Shapes.txt = Shapes.txt
|
||||
Zones.txt = Zones.txt
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Themes", "Themes", "{74492CBC-7201-417E-BC29-28B4C25A58B0}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Specs", "Specs", "{3E10BF6D-ADA5-417D-B36C-EBB0660B475E}"
|
||||
|
@@ -87,6 +87,29 @@ namespace Orchard.Environment.Extensions.Loaders {
|
||||
return result;
|
||||
}
|
||||
|
||||
public override void ReferenceActivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) {
|
||||
//Note: This is the same implementation as "PrecompiledExtensionLoader"
|
||||
if (string.IsNullOrEmpty(referenceEntry.VirtualPath))
|
||||
return;
|
||||
|
||||
string sourceFileName = _virtualPathProvider.MapPath(referenceEntry.VirtualPath);
|
||||
|
||||
// Copy the assembly if it doesn't exist or if it is older than the source file.
|
||||
bool copyAssembly =
|
||||
!_assemblyProbingFolder.AssemblyExists(referenceEntry.Name) ||
|
||||
File.GetLastWriteTimeUtc(sourceFileName) > _assemblyProbingFolder.GetAssemblyDateTimeUtc(referenceEntry.Name);
|
||||
|
||||
if (copyAssembly) {
|
||||
context.CopyActions.Add(() => _assemblyProbingFolder.StoreAssembly(referenceEntry.Name, sourceFileName));
|
||||
|
||||
// We need to restart the appDomain if the assembly is loaded
|
||||
if (_hostEnvironment.IsAssemblyLoaded(referenceEntry.Name)) {
|
||||
Logger.Information("ReferenceActivated: Reference \"{0}\" is activated with newer file and its assembly is loaded, forcing AppDomain restart", referenceEntry.Name);
|
||||
context.RestartAppDomain = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Assembly LoadReference(DependencyReferenceDescriptor reference) {
|
||||
if (Disabled)
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user