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 946975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:00:28+00:00 2026-05-15T23:00:28+00:00

I m trying to not target a specific version of a dll but I

  • 0

I m trying to not target a specific version of a dll but I m not quite sure how.
I have set the option Specific Version on the properties of the assembly to false, however if i try to run the application and the version of the requested assembly is a previous one, I get a:

FileLoadException: Could not load file or assembly 

This is happening when the version of the referenced dll does not exactly match the current one.
I would believe that the issue is on how to reference this 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-15T23:00:29+00:00Added an answer on May 15, 2026 at 11:00 pm

    In general, if you are trying to use a specific version of an assembly the below doesn’t really apply, you should just use the version you need.

    However, sometimes you can run into a situation where you have this:

    AssemblyX – references version 1.2.1 of AssemblyZ
    AssemblyY – references version 1.2.2 of AssemblyZ

    But your project needs both AssemblyX and AssemblyY.

    So how do you resolve this? You can either put 1.2.1 and 1.2.2 of AssemblyZ in the GAC, or, if you’re sure there aren’t any compatibility issues, you can use assembly rebinding. Here’s an example (this goes in your Web.config or App.config file):

    <configuration>
       <runtime>
          <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
             <dependentAssembly>
                <assemblyIdentity name="myAssembly"
                                  publicKeyToken="32ab4ba45e0a69a1"
                                  culture="neutral" />
                <bindingRedirect oldVersion="1.0.0.0"
                                 newVersion="2.0.0.0"/>
             </dependentAssembly>
          </assemblyBinding>
       </runtime>
    </configuration>
    

    What this basically says is that if any assemblies in your solution reference 1.0.0.0 of myAssembly, then they should really use version 2.0.0.0. And you’re expected to have version 2.0.0.0 present in the path.

    A hack you can use when you always want them to use a specific version of the assembly is to specify a version range, like this:

            <dependentAssembly>
                <assemblyIdentity name="MyAssembly" publicKeyToken="B7567367622062C6" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="1.2.1.0" />
            </dependentAssembly>
    

    This will force version 1.2.1.0 of MyAssembly to be used for any version reference of MyAssembly between 0.0.0.0 and 3.0.0.0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm basically trying to get the target element from event.target and if not equal
Trying not to lose it here. As you can see below I have assigned
require('fortunes') fortune('106') Personally I have never regretted trying not to underestimate my own future
I have two classess and a Userform. I am trying not to use any
I'm trying to not repeat code, so I have a method that does a
I have been trying to ping a specific IP and port to check if
I am not sure this is even possible, but I am hoping for a
im trying to invoke a specific class from within a jar file but I'm
I am sure this is a pretty easy answer, but I have been pulling
I am not trying to create a BOOT_COMPLETED receiver (and doing so would not

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.