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

Add path to 4 not-absolute-path exceptions #27470

Merged
1 commit merged into from
Oct 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/System.Private.CoreLib/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@
<value>The value "{0}" is not of type "{1}" and cannot be used in this generic collection.</value>
</data>
<data name="Argument_AbsolutePathRequired" xml:space="preserve">
<value>Absolute path information is required.</value>
<value>Path "{0}" is not an absolute path.</value>
</data>
<data name="Argument_AddingDuplicate" xml:space="preserve">
<value>An item with the same key has already been added.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static Assembly LoadFile(string path)

if (PathInternal.IsPartiallyQualified(path))
{
throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(path));
throw new ArgumentException(SR.Format(SR.Argument_AbsolutePathRequired, path), nameof(path));
}

string normalizedPath = Path.GetFullPath(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public Assembly LoadFromAssemblyPath(string assemblyPath)

if (PathInternal.IsPartiallyQualified(assemblyPath))
{
throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(assemblyPath));
throw new ArgumentException(SR.Format(SR.Argument_AbsolutePathRequired, assemblyPath), nameof(assemblyPath));
}

lock (_unloadLock)
Expand All @@ -319,12 +319,12 @@ public Assembly LoadFromNativeImagePath(string nativeImagePath, string? assembly

if (PathInternal.IsPartiallyQualified(nativeImagePath))
{
throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(nativeImagePath));
throw new ArgumentException(SR.Format(SR.Argument_AbsolutePathRequired, nativeImagePath), nameof(nativeImagePath));
}

if (assemblyPath != null && PathInternal.IsPartiallyQualified(assemblyPath))
{
throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(assemblyPath));
throw new ArgumentException(SR.Format(SR.Argument_AbsolutePathRequired, assemblyPath), nameof(assemblyPath));
}

lock (_unloadLock)
Expand Down Expand Up @@ -394,7 +394,7 @@ protected IntPtr LoadUnmanagedDllFromPath(string unmanagedDllPath)

if (PathInternal.IsPartiallyQualified(unmanagedDllPath))
{
throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(unmanagedDllPath));
throw new ArgumentException(SR.Format(SR.Argument_AbsolutePathRequired, unmanagedDllPath), nameof(unmanagedDllPath));
}

return NativeLibrary.Load(unmanagedDllPath);
Expand Down