Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 653cb2f

Browse files
authored
Load the assembly from the same location as the type assembly (#22558) (#24128)
1 parent c30b3ed commit 653cb2f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ internal static Assembly LoadGeneratedAssembly(Type type, string defaultNamespac
172172
name.Name = serializerName;
173173
name.CodeBase = null;
174174
name.CultureInfo = CultureInfo.InvariantCulture;
175+
string serializerPath = Path.Combine(Path.GetDirectoryName(type.Assembly.Location), serializerName + ".dll");
175176
try
176177
{
177-
serializer = Assembly.LoadFile(Path.GetFullPath(serializerName) + ".dll");
178+
serializer = Assembly.LoadFile(serializerPath);
178179
}
179180
catch (Exception e)
180181
{

0 commit comments

Comments
 (0)