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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:13:34+00:00 2026-06-10T06:13:34+00:00

Due to a serious headache with log4net’s strong naming and versioning, i.e., the old

  • 0

Due to a serious headache with log4net’s strong naming and versioning, i.e., the old 1.2.10 name, the new 1.2.11 name, and (heaven help me) the 1.2.10 one SAP made and shoved into the GAC with its own strong name, my application will refuse to run on any machine but my own. It keeps looking for version 1.2.11 of the strongly named SAP version, which doesn’t exist.

As nothing in my project is strongly named, I want to stop the compiler from looking for a strongly named assembly and just load the one I put in the directory. Since it is complaining about the manifest not matching, I’m trying to find a reference in my project for that version and public key, but I am coming up short. It seems this manifest is created at compile time.

How can I override that? is there a property or switch or conditional compilation I can use to specify exactly which assembly I wish to reference?

Ultimately I want to use the 1.2.11 version of log4net, and force the assembly to ignore the version in the GAC, to look only in the local bin directory. This really shouldn’t be this painful.

  • 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-06-10T06:13:35+00:00Added an answer on June 10, 2026 at 6:13 am

    Runtime Directive

    At runtime, you can use AppDomain.AssemblyResolve to combat the assembly versioning issue when you don’t care what specific version is present, you just want to load what’s in the /bin folder. This code was created with inspiration from here.

    string[] ignoreAssembyVersions = new string[] { "log4net" };
    AppDomain.CurrentDomain.AssemblyResolve += (_, assembly) =>
    {
        //ignore the vesion number and return any version that has been loaded
        var name = new AssemblyName(assembly.Name);
        var shortName = name.Name; // retrieve short name
        if (ignoreAssembyVersions.Contains(shortName)) // compare against list of assemblies we ignore revisions for
        {
            // check if this assembly is already loaded under a different version #
            Assembly[] allAss = AppDomain.CurrentDomain.GetAssemblies();
            List<Assembly> list = new List<Assembly>(allAss);
            var loadedAssembly = list.Find(ass => new AssemblyName(ass.FullName).Name == shortName); // check if we have any version loaded yet
            if (loadedAssembly != null)
                return loadedAssembly;
            else // assembly has not yet been loaded in this domain
            {   // probe for assembly by name
                Assembly probedAssembly = Assembly.LoadFrom(string.Format("{0}.dll", shortName)); // probe for any match on assembly.dll 
                return probedAssembly;
            }
        }
        return null; // ignore binding failure -> pass up the stack
    };
    

    An alternative to handling the AssemblyResolve event would be to use a custom bindingRedirect policy. However – this only works if you know what version is present in the /bin or currently loaded in the App Domain.

    Build-Time Directive

    If you want control of which assembly version is used at build-time, you can use the Specific Version='true' for assembly references you add.

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

Sidebar

Related Questions

Due to security reasons our legacy application is split into 2 web applications, one
Fairly new to iPhone dev. My app uses Core Data, and at one point
Due to repetitive errors with one of our Java applications: Engine engine_0: Error in
Due to a requirement I have to call one stored procedure from another. The
Due to pressure from outside our group, we have to port over one hundred
due to performance reasons I didn't feel like using fstream for just one time.
Due to the limit of 5 fusion table layers and 5 styles of one
Due to a sad situation I receive HTML like this: <p>Perform the following commands:
Due to legacy reasons a lot of our data is stored encoded in standard
Due to an incident a few months prior, thousands of author_ids have been deleted

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.