Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3405356
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:29:44+00:00 2026-05-18T05:29:44+00:00

My project references Library1.dll and Library2.dll . Library2.dll has a dependency on Library1.dll ,

  • 0

My project references Library1.dll and Library2.dll. Library2.dll has a dependency on Library1.dll, but it was compiled to reference it by a different name, Library1.Net40.dll.

Is there an nice way tell my application to redirect all references for Library1.Net40.dll to resolve to Library1.dll? Maybe something similar to the way you can redirect versions using a <bindingRedirect>?

I’ve got a solution that handles the AppDomain.AssemblyResolve event, but it’s a bit of a hack and am hoping there’s a better way to do this.

Edit:
For anyone’s reference, here’s how I ended up solving it using the AppDomain.AssemblyResolve event to redirect to a different assembly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:29:44+00:00Added an answer on May 18, 2026 at 5:29 am

    Have you tried playing with the <codeBase> element?

    <configuration>
       <runtime>
          <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
             <dependentAssembly>
                <assemblyIdentity name="Library1.Net40"
                                  publicKeyToken="..."
                                  culture="neutral" />
                <codeBase version="2.0.0.0"
                          href="Library1.dll"/>
             </dependentAssembly>
          </assemblyBinding>
       </runtime>
    </configuration>
    

    (Untested; no idea if it works.)

    CF: Am putting this update here, because it’s a bit long for the comments 🙂

    Good idea, thanks. I got the redirect working but it complains because the names are different, here’s the log:

    LOG: Attempting download of new URL file:///C:/Project/bin/Library1.dll.
    LOG: Assembly download was successful. Attempting setup of file: C:\Project\bin\Library1.dll
    LOG: Entering download cache setup phase.
    LOG: Assembly Name is: Library1, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
    WRN: Comparing the assembly name resulted in the mismatch: NAME
    ERR: The assembly reference did not match the assembly definition found.
    ERR: Setup failed with hr = 0x80131040.
    ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class library project that references the version 4.1 Microsoft.Practices.Common dll. I
There is a virtual method in a library that my C# project references. How
Attempting to build a C# project which has numerous references to assemblies in NuGet
I have a dll project that references Microsoft.Practices.EnterpriseLibrary.Common.dll (= the dll ) from my
I have an ASP.NET VB.NET web project that references a VB.NET class library. I
I have a Windows Forms project in Visual Studio 2008, which references a library
I have an ASP.NET web application project which references another project called ModusCore (or
Let's say I have two simple models project t.string :title vote t.references :project t.integer
SCENARIO One VS solution with n projects. Project A references package Y v1, Project
Eclipse is complaining about my Android project saying all my references to resources are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.