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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:44:41+00:00 2026-05-26T21:44:41+00:00

I have a .dll built in C++/CLI and .NET. Therefore, it is targeted to

  • 0

I have a .dll built in C++/CLI and .NET. Therefore, it is targeted to .NET applications. The API is a set of wrappers that uses managed types so it is NET native. I have imported the .dll and added a function like:

[DllImport(@"maplib.dll")]
public static extern bool initialize(string a);

When I call this function in my C# code, it works fine, but if I want to add another function, like..

[DllImport(@"maplib.dll")]
public static extern bool initialize(string a);
public static extern bool runfile(string a, string b);

I get this error when I run my program. It is related to the second function:

“Could not load type ‘myapp.main’ from assembly ‘myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ because the method ‘runfile’ has no implementation (no RVA).”

Why does this error occur and how can I 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-26T21:44:42+00:00Added an answer on May 26, 2026 at 9:44 pm

    You must add the DllImport attribute twice if you want two functions:

    [DllImport(@"maplib.dll")]
    public static extern bool initialize(string a);
    [DllImport(@"maplib.dll")]
    public static extern bool runfile(string a, string b);
    

    But if your dll is .NET then why not just add a regular reference to it and use it like you would use C# code?

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

Sidebar

Related Questions

I have a visual C# 2010 express install. Built a .NET 4.0 dll that
I have a simple .NET dll built with VS2010 C# that exposes 2 static
I have built a .dll under WinXP that claims it can't find DWMAPI.DLL when
I have a project that comprises pre-build Dll modules, built some time in the
we have a C++ Win32 DLL that reads data from Excel. The application uses
Suppose I have a DLL which is built with LARGEADDRESSAWARE linker flag set. Now
I have a com dll built in .net and referred it as a interop.mycomlib.dll
I have a .dll I'm using inside a wix-built .msi that is currently returning
I have a 3rd DLL that is built for Any CPU. It needs (for
I have an application written in .NET 4.0 that i compile into a DLL

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.