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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:41:18+00:00 2026-06-01T01:41:18+00:00

I have a .dll that I generated thorugh a C++ project. I have to

  • 0

I have a .dll that I generated thorugh a C++ project. I have to use this dll in my ASP.NET project and I have written DllImport functions for the same in my project.

The static class inside App_Code has some DllImport functions

public static class Functions
{
    [DllImport("MyFav.dll", EntryPoint = "fnmain", 
     CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
    public static extern StringBuilder fnmain();
}

Since I could not add the C++ dll directly as a reference in my ASP.NET project (because it is not a .NET assembly), I just copied into the top level directory. ( Name of ASP.NET Project-> Right Click -> Add Existing Item )

Now, when I try to run the project, I get the following error:

Exception:

Unable to load DLL ‘MyFav.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Any suggestions? Where has the .dll to be kept?

  • 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-01T01:41:20+00:00Added an answer on June 1, 2026 at 1:41 am

    The .dll should be in the \bin folder of your asp.net application.

    Apparently there are rules for how dlls are resolved. See Dynamic-Link Library Search Order on msdn

    You could also try:

    [DllImport("C:\path_to_dll\MyFav.dll", EntryPoint = "fnmain", 
     CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
    public static extern StringBuilder fnmain();
    

    If all this doesn’t work, maybe your MyFav.dll has additional unresolved dependencies. You could use Dependency Walker to check for these.

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

Sidebar

Related Questions

I have a DLL that is written in C++ and I want to suppress
I have a DLL that I can use to pull the following information about
I have a .DLL that i include in my Visual Studio 2008 project. The
I have a dll that comes in both 32bit and 64bit version. My .NET
I have DLL and application that will call some function in this dll. For
I have a .Net DLL that I created that implements a WCF client that
I have a .NET DLL that writes to the Trace. But it seems that
I have an Interop dll that was generated by Visual Studio for a third-party
We have a classic ASP page that is instantiating a .Net object through a
I've written a multi-project .vstemplate file, which works alright, except that the projects have

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.