@@ -1669,21 +1669,21 @@ BOOL EEFileLoadException::CheckType(Exception* ex)
16691669
16701670// Helper method to create a FileLoadException with custom message for version conflicts
16711671/* static */
1672- EEFileLoadException* EEFileLoadException::CreateVersionConflictException (const SString &name, Exception *pInnerException)
1672+ EEFileLoadException* EEFileLoadException::CreateVersionConflictException (const SString &name, Exception *pInnerException, AssemblySpec *pSpec )
16731673{
16741674 // Create exception with FUSION_E_REF_DEF_MISMATCH to maintain backward compatibility
16751675 // (existing code checks for this HRESULT, e.g., Marshal.cs)
16761676 EEFileLoadException *pException = new EEFileLoadException (name, FUSION_E_REF_DEF_MISMATCH, pInnerException);
16771677
1678- // Use FUSION_E_APP_DOMAIN_LOCKED's message which specifically describes version conflicts:
1679- // "The requested assembly version conflicts with what is already bound..."
1680- // This provides a clearer error than FUSION_E_REF_DEF_MISMATCH's generic message.
1678+ // Build custom message with version conflict details
1679+ // The name parameter already includes the full requested assembly identity with version
16811680 StackSString formatString;
16821681 formatString.LoadResource (IDS_EE_FILELOAD_ERROR_GENERIC);
16831682 StackSString versionMessage;
16841683 GetHRMsg (FUSION_E_APP_DOMAIN_LOCKED, versionMessage);
16851684 StackSString customMessage;
16861685 customMessage.FormatMessage (FORMAT_MESSAGE_FROM_STRING, formatString.GetUnicode (), 0 , 0 , name, versionMessage);
1686+
16871687 pException->m_customMessage .Set (customMessage);
16881688
16891689 return pException;
@@ -1718,7 +1718,7 @@ void DECLSPEC_NORETURN EEFileLoadException::Throw(AssemblySpec *pSpec, HRESULT
17181718 // message to provide clearer information about version conflicts.
17191719 if (hr == FUSION_E_APP_DOMAIN_LOCKED)
17201720 {
1721- EEFileLoadException *pException = CreateVersionConflictException (name, pInnerException);
1721+ EEFileLoadException *pException = CreateVersionConflictException (name, pInnerException, pSpec );
17221722 PAL_CPP_THROW (EEFileLoadException *, pException);
17231723 }
17241724
0 commit comments