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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:37:18+00:00 2026-05-20T18:37:18+00:00

I load a C++ DLL using DLLImport in my C# ASP.Net web application. The

  • 0

I load a C++ DLL using DLLImport in my C# ASP.Net web application. The DLL basically reads some CSV files, and manipulates them and creates new files.

After I ran the method successfully, and run it again then I get C++ exception back.

I want to unload the C++ DLL from the website so a user can re- load the DLL and re run the method. Do you know how to either eliminate this error or get rid of this error message so the DLL can be unloaded after its run?

  • 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-20T18:37:19+00:00Added an answer on May 20, 2026 at 6:37 pm

    As far as I’m aware, there’s no way to do late binding with C#.

    You can do it by creating a C++ DLL and using that, however. Assuming you know enough about C++ to do this, you would just need a single function exported by the DLL, which uses LoadLibrary to load your CSV manipulation DLL, GetProcAddress to retrieve the address of the function you want to call, and then FreeLibrary to release the library.

    An example would be something like:

    extern "C" {
      __declspec(dllexport) bool InvokeMyFunction() {
        HMODULE lib = LoadLibrary("csvlib.dll");
        if (!lib)
          return false;
    
        void (*func)(int) = (void (*)(int))GetProcAddress(lib, "MyCsvFunc");
        if (!func)
          return false;
    
        func(5);
    
        FreeLibrary(lib);
    
        return true;
      }
    }
    

    This isn’t completely safe, though. If possible, it’s better to find out what the problem with your DLL function being called more than once is, and fixing it.

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

Sidebar

Related Questions

I need to use a dll in my asp.net application. How do I load
I'm using the following code in a vb.net 2008 project to dynamically load dll's
I'm using ctypes to load a DLL in Python. This works great. Now we'd
I am trying to load Linq on my .Net 3.5 enabled web server by
I’m having some difficulties while trying to consume an unmanaged-code dll from my application
I have been trying to load a 32-bit dll using C++ (from a 32-bit
I'm trying to use native dll, using DllImport. And I receive such error. System.DllNotFoundException:
HI all I have a dll c#.net project and it refers some other sub
I load a dll dynamically using an Applicationdomain to unload when nessesary. What i
I'm creating an application in C# using Visual Studio 2010/.NET 4.0. For part of

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.