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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:58:43+00:00 2026-05-18T03:58:43+00:00

A website I’m working on is using a third-party assembly, let’s say A.dll. This

  • 0

A website I’m working on is using a third-party assembly, let’s say A.dll. This assembly A also loads another assembly B for some operations. The use that my website makes out of A doesn’t require B at all, and I don’t have B.dll.

This was never a problem when I was targetting .NET 3.5, but now that I’m trying to move to .NET 4, I get an error. When I view my website in the browser, I get: “Could not load file or assembly ‘B.dll’ […]”. If I put B.dll in the bin directory, it works fine.

However, I don’t want to deploy B.dll and I don’t know what makes .NET 4 try to load that assembly while the website does not use any function of A that requires it. I’m mystified as the same code works fine on .NET 3.5. I’m guessing that it tries to load all assemblies in advance, even if it won’t be used. I’m looking for some configuration or compiler flag that would prevent this behavior. Any pointers?

I tried to simplify my problem by omitting details and reasons why I don’t want B deployed, etc. Please let me know if the information I’ve given doesn’t give a clear shot of the problem. Thanks!

EDIT:

Stack trace

[FileNotFoundException: Could not load file or assembly ‘B, Version=15.4.0.0, Culture=neutral, PublicKeyToken=1a5b964d6f0fbeab’ or one of its dependencies. The system cannot find the file specified.]

_Default.Page_Load(Object sender, EventArgs e) in c:\Users\bob\Desktop\WebSite1\Default.aspx.cs:15

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

Assembly load trace

=== Pre-bind state information ===
LOG: User = bob
LOG: DisplayName = B, Version=15.4.0.0, Culture=neutral, PublicKeyToken=1a5b964d6f0fbeab
(Fully-specified)
LOG: Appbase = file:///C:/Users/bob/Desktop/WebSite1/
LOG: Initial PrivatePath = C:\Users\bob\Desktop\WebSite1\bin
Calling assembly : A, Version=16.0.0.0, Culture=neutral, PublicKeyToken=null.

===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\bob\Desktop\WebSite1\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: B, Version=15.4.0.0, Culture=neutral, PublicKeyToken=1a5b963c6f0fbeab
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/website1/efdbfea0/f60231a3/B.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/website1/efdbfea0/f60231a3/B/B.DLL.
LOG: Attempting download of new URL file:///C:/Users/bob/Desktop/WebSite1/bin/B.DLL.
LOG: Attempting download of new URL file:///C:/Users/bob/Desktop/WebSite1/bin/B/B.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/website1/efdbfea0/f60231a3/B.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/website1/efdbfea0/f60231a3/B/B.EXE.
LOG: Attempting download of new URL file:///C:/Users/bob/Desktop/WebSite1/bin/B.EXE.
LOG: Attempting download of new URL file:///C:/Users/bob/Desktop/WebSite1/bin/B/B.EXE.

  • 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-18T03:58:44+00:00Added an answer on May 18, 2026 at 3:58 am

    Found the problem; one of the methods in the assembly we were calling had a value type from B.dll in a method signature. In .NET 4.0, this will load B.dll even if that method is never called.

    The solution was to modify the method signature to remove all references to B’s value types.

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

Sidebar

Related Questions

No related questions found

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.