Skip to content
Permalink
Browse files

#1133 : Fixed an issue where the type could not be resolved.

  • Loading branch information...
michaellwest committed Sep 8, 2019
1 parent a38d76b commit b2bc9971aa3d15333a1ea21c6bea5cae7871e501
@@ -34,6 +34,7 @@
<ItemGroup>
<Reference Include="Sitecore.ContentSearch, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.ContentSearch.NoReferences.8.2.170728\lib\NET452\Sitecore.ContentSearch.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.Kernel, Version=10.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Kernel.NoReferences.8.2.170728\lib\NET452\Sitecore.Kernel.dll</HintPath>
@@ -34,6 +34,7 @@
<ItemGroup>
<Reference Include="Sitecore.ContentSearch, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.ContentSearch.9.2.0\lib\net471\Sitecore.ContentSearch.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Kernel.9.2.0\lib\net471\Sitecore.Kernel.dll</HintPath>
@@ -17,7 +17,6 @@ public override void Process(PreprocessRequestArgs arguments)
Assert.ArgumentNotNull(arguments, "arguments");
try
{
Assert.ArgumentNotNull(arguments.Context, "context");
var url = TypeResolver.Resolve<IObsoletor>().GetRequestUrl(arguments);
var localPath = url.LocalPath;

@@ -11,7 +11,7 @@ namespace Spe.Core.VersionDecoupling
public static class TypeResolver
{
private static readonly ConcurrentDictionary<string, object> TypeCache = new ConcurrentDictionary<string, object>();
private static readonly ConcurrentDictionary<string, Assembly> LoadedAssemblies = new ConcurrentDictionary<string, Assembly>();
internal static readonly ConcurrentDictionary<string, Assembly> LoadedAssemblies = new ConcurrentDictionary<string, Assembly>();

public static T Resolve<T>(object[] parameters = null)
{
@@ -44,7 +44,9 @@ private static Assembly LoadVersionAssembly(string assemblyNamespace, string ass
{
var data = new byte[stream.Length];
stream.Read(data, 0, data.Length);
return Assembly.Load(data);
var loadedAssembly = Assembly.Load(data);
TypeResolver.LoadedAssemblies.TryAdd(assemblyName, loadedAssembly);
return loadedAssembly;
}
}
}

0 comments on commit b2bc997

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