Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message for invalid assembly name #67882

Merged
merged 1 commit into from
Apr 12, 2022
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/coreclr/dlls/mscorrc/mscorrc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BEGIN
FUSION_E_SIGNATURE_CHECK_FAILED "Strong name signature verification failed for assembly '%1'. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key."
COR_E_MODULE_HASH_CHECK_FAILED "The check of the module's hash failed for file '%1'."
FUSION_E_PRIVATE_ASM_DISALLOWED "Assembly '%1' is required to be strongly named."
FUSION_E_INVALID_NAME "The given assembly name or codebase, '%1', was invalid."
FUSION_E_INVALID_NAME "The given assembly name, '%1', was invalid."
FUSION_E_ASM_MODULE_MISSING "A module specified in the manifest of assembly '%1' could not be found."
FUSION_E_CODE_DOWNLOAD_DISABLED "HTTP download of assemblies has been disabled for this appdomain."
FUSION_E_HOST_GAC_ASM_MISMATCH "The assembly returned from the host store has a different strong name signature than the corresponding one in GAC. Assembly: '%1'"
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/inc/corerror.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@

<HRESULT NumericValue="0x80131047">
<SymbolicName>FUSION_E_INVALID_NAME</SymbolicName>
<Message>"The given assembly name or codebase was invalid."</Message>
<Comment> The given assembly name or codebase was invalid. </Comment>
<Message>"The given assembly name was invalid."</Message>
<Comment> The given assembly name was invalid. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131048">
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/prebuilt/corerror/mscorurt.rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BEGIN
MSG_FOR_URT_HR(FUSION_E_ASM_MODULE_MISSING) "A module specified in the manifest was not found."
MSG_FOR_URT_HR(FUSION_E_PRIVATE_ASM_DISALLOWED) "A strongly-named assembly is required."
MSG_FOR_URT_HR(FUSION_E_SIGNATURE_CHECK_FAILED) "Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key."
MSG_FOR_URT_HR(FUSION_E_INVALID_NAME) "The given assembly name or codebase was invalid."
MSG_FOR_URT_HR(FUSION_E_INVALID_NAME) "The given assembly name was invalid."
MSG_FOR_URT_HR(FUSION_E_CODE_DOWNLOAD_DISABLED) "HTTP download of assemblies has been disabled for this appdomain."
MSG_FOR_URT_HR(FUSION_E_HOST_GAC_ASM_MISMATCH) "Assembly in host store has a different signature than assembly in GAC."
MSG_FOR_URT_HR(FUSION_E_LOADFROM_BLOCKED) "LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host."
Expand Down
2 changes: 1 addition & 1 deletion src/installer/tests/HostActivation.Tests/StartupHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public void Muxer_activation_of_StartupHook_With_Invalid_Simple_Name_Fails()
.Execute(fExpectedToFail: true)
.Should().Fail()
.And.HaveStdErrContaining(string.Format(expectedError, startupHookVar))
.And.HaveStdErrContaining("---> System.IO.FileLoadException: The given assembly name or codebase was invalid.");
.And.HaveStdErrContaining("---> System.IO.FileLoadException: The given assembly name was invalid.");

// Relative path error is caught before any hooks run
startupHookVar = startupHookDll + Path.PathSeparator + relativeAssemblyPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@
<value>Target array type is not compatible with the type of items in the collection.</value>
</data>
<data name="InvalidAssemblyName" xml:space="preserve">
<value>The given assembly name or codebase was invalid.</value>
<value>The given assembly name was invalid.</value>
</data>
<data name="Argument_InvalidCalendar" xml:space="preserve">
<value>Not a valid calendar for the given culture.</value>
Expand Down