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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:27:02+00:00 2026-05-19T01:27:02+00:00

I’m writing a .NET 3.5 application (WinForms) which uses classes from an external DLL

  • 0

I’m writing a .NET 3.5 application (WinForms) which uses classes from an external DLL and I keep receiving a System.TypeLoadException every time the application tries to start.
Here is the exception VS displays:

System.TypeLoadException was unhandled
  Message=Could not load type 'PolyMorph.Common.Settings' from assembly 'PolyMorph, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
  Source=PolyMorph
  TypeName=PolyMorph.Common.Settings
  StackTrace:
       at PolyMorphApp.App.Initialize()
       at PolyMorphApp.App.Main()
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Here is the code that I’m running:

Friend NotInheritable Class App

    <STAThread()> Shared Sub Main()
        'set the exception handlers'
        Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException)
        AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf UnhandledExceptionHandler
        AddHandler Application.ThreadException, AddressOf ThreadExceptionHandler
        'initialize the application'
        App.Initialize()

        'and then run the application'
        Dim mainForm As New PolymorphHost
        Application.Run(mainForm)
    End Sub

    Shared Function Initialize() As FunctionResult
        If App.InitializeDataDirectory() = False Then
            Return New FunctionResult(False, "the application's data directory")
        End If


        _settings = New PolyMorph.Common.Settings(AppDataDirectory & "\Settings.dat")
        ......code continues to load settings from the _settings variable
    End Function
End Class

What surprises me is that the VS2010 Debugger stops on the line App.Initialize() without even stepping into the Initialize function.

If, however, I comment out all references to the external DLL in the Initialize function, the application initializes properly.


After reading around, I realized that a number of people reporting this error were using different builds on their projects (as in x64 DLL being referenced from an x86 application). I therefore changed the build configuration so the DLL and the application were both x86 but I still have the TypeLoadException.

Is there anything I’m missing?

  • 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-19T01:27:03+00:00Added an answer on May 19, 2026 at 1:27 am

    It appears one Nutzy also had a similar problem and he solved it by copying all the classes, forms and controls to a new project. I did likewise and the problem was solved.

    Thanks, Jim Mischel and Paul Alexander for your assistance. I voted you up for your efforts to help me solve the problem.

    • 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.