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

  • Home
  • SEARCH
  • 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 6198331
In Process

The Archive Base Latest Questions

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

I have a .NET 4.0 class that uses Assembly.LoadFrom to load a .NET 3.5

  • 0

I have a .NET 4.0 class that uses Assembly.LoadFrom to load a .NET 3.5 mixed mode assembly. When this class is called from a .NET 4.0 app (with useLegacyV2RuntimeActivationPolicy=”true” specified in the config file) it all works fine.

However, this class is also COM visible, and when I then call it from Excel 2007 (again, Excel.exe.config specifies useLegacyV2RuntimeActivationPolicy=”true”) I get a FileLoadException:

Could not load file or assembly ‘Foo…’ or one of its dependencies. Failed to load the runtime. (Exception from HRESULT: 0x80131700)

The inner exception is a System.Runtime.InteropServices.COMException: Failed to load the runtime. (Exception from HRESULT: 0x80131700)

I do not get this problem when calling from Excel 2003 or Excel 2010 or vbscript. Can someone explain what is going on and how I can fix it?

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

    I’ve discovered from Microsoft that this is a known issue with Excel 2007. The problem has been resolved in Excel 2010, and the issue will not be fixed in Excel 2007.

    The workaround is to force Excel to use a COM-exposed .NET 2.0 type before using the .NET 4.0 class. I did this by adding a reference to the .NET 2.0 version of mscorlib.tlb, and then adding the following VBA code before calling the .NET 4.0 class:

    Dim o as mscorlib.Object
    Set o = New mscorlib.Object
    

    Hope this proves useful to anyone who stumbles across this obscure issue!

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

Sidebar

Related Questions

if i have a .net 1.1 class that inherits from DictionaryBase and i am
I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on
Using Visual Studio 2008 and VB.Net: I have a working web app that uses
I have a class that uses 'System.Net.Sockets.Socket' directly for network comunication, and currently I
I have a class that uses PHP's ereg() which is deprecated. Looking on PHP.net
I have an ASP.NET webpage running under IIS that uses a common assembly that
I have a Windows Mobile 6.5 (.net cf 3.5) that uses a singleton class
I have an unmanaged assebmly (encryption functionality) that a VB.NET (2.0) installer class uses
I have an ASP.Net webforms app, that uses Ninject 2.2.0.0 I have a HTTPHandler
I have some .Net 3.5 code that uses the XDocument class. Can you suggest

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.