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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:29:06+00:00 2026-05-27T03:29:06+00:00

I have a solution with a C++ dll project and a C# project that

  • 0

I have a solution with a C++ dll project and a C# project that uses it. The problem is that the build path of the c++ project is in the solution folder and the c# is in the project’s bin folder (each nested with debug/release), so the DllImport doesn’t find them.
Is there a standard way to fix this?

  • 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-27T03:29:06+00:00Added an answer on May 27, 2026 at 3:29 am

    The way you are supposed to do this is to set the build path for both projects to the same ‘bin’ directory… preferrably one for the solution, not a project. Then just make all projects build to that one folder. You can change that from the Project settings.

    Another technique is to use a post-build step for the C++ app that copies the DLL to the C# project’s folder. That way you don’t actually change any paths. You just copy over a DLL. Be careful here though because when you clean the C++ file’s project, you may actually still have the copy in the C# projec’ts bin directory leaving you scratching your head as to why things aren’t happening as expected.

    Alternately, you can deploy the C++ DLL to a system path (also as part of a post-build step) but you’ll have the same issues as stated above.

    For debugging, I’d recommend these in the order presented.

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

Sidebar

Related Questions

I have a dll project in a solution that I want to debug. The
In my solution I have a DLL project, say Project1 , that owns a
I have a Visual Studio 2010 solution that contains 3 projects: a dll project,
I have a solution in VS 2008 that creates a DLL. I then use
I have a solution with several projects, where the startup project has a post-build
I have a solution with an unmanaged c++ dll project in it and a
I have an *.exe project that was written in one solution under vs2005 and
I have a Java project that uses this driver for serial communication. The driver
I have a dll project that references Microsoft.Practices.EnterpriseLibrary.Common.dll (= the dll ) from my
I have a VB6 application that uses a COM DLL. The DLL is written

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.