Skip to content

Commit 7b22cf7

Browse files
fix path
1 parent ed916c2 commit 7b22cf7

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

private/assembly-redirector.ps1

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public class Redirector
8585
if (systemDlls.Contains(assemblyName))
8686
{
8787
// Try desktop folder first for Windows PowerShell
88-
string filelocation = "$dir" + "desktop\\net472\\" + assemblyName + ".dll";
88+
string filelocation = "$dir" + "desktop\\" + assemblyName + ".dll";
8989
if (System.IO.File.Exists(filelocation))
9090
{
9191
var asm = Assembly.LoadFrom(filelocation);
@@ -105,7 +105,7 @@ public class Redirector
105105
if (azureDlls.Contains(assemblyName))
106106
{
107107
// Try desktop folder first for Windows PowerShell
108-
string filelocation = "$dir" + "desktop\\net472\\" + assemblyName + ".dll";
108+
string filelocation = "$dir" + "desktop\\" + assemblyName + ".dll";
109109
if (System.IO.File.Exists(filelocation))
110110
{
111111
var asm = Assembly.LoadFrom(filelocation);
@@ -125,7 +125,7 @@ public class Redirector
125125
if (sqlDlls.Contains(assemblyName))
126126
{
127127
// Try desktop folder first for Windows PowerShell
128-
string filelocation = "$dir" + "desktop\\net472\\" + assemblyName + ".dll";
128+
string filelocation = "$dir" + "desktop\\" + assemblyName + ".dll";
129129
if (System.IO.File.Exists(filelocation))
130130
{
131131
var asm = Assembly.LoadFrom(filelocation);
@@ -149,11 +149,19 @@ public class Redirector
149149
}
150150
}
151151
152+
// Handle version binding redirects
152153
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
153154
{
154155
var info = assembly.GetName();
155-
if (info.FullName == e.Name) {
156-
return assembly;
156+
if (info.Name == name.Name) {
157+
// For System.Memory, allow newer versions to satisfy older version requests
158+
if (info.Name == "System.Memory" && info.Version > name.Version) {
159+
return assembly;
160+
}
161+
// For exact version matches
162+
if (info.FullName == e.Name) {
163+
return assembly;
164+
}
157165
}
158166
}
159167
return null;

0 commit comments

Comments
 (0)