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

  • Home
  • SEARCH
  • 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 9205355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:55:55+00:00 2026-06-17T23:55:55+00:00

I built a C# application with WPF on Visual Studio 2012 that uses C++

  • 0

I built a C# application with WPF on Visual Studio 2012 that uses C++ DLL and targets .NET4.5. I have two projects running, one for the C# project and the other for C++ DLL project. I released both projects into a folder that has a .exe for C# and a .dll for C++ in the same folder.

I run them on my machine where they were developed and everything works fine. I run the .exe in other machines and it throws this exception:

System.DllNotFoundException: Unable to load DLL

It’s not recognizing the DLL that is in the same folder.

I tried many things and nothing seems to work. I followed the solution in this post but nothing worked.

The Dev and Target machine are identical. In Dev, Visual Studio 2012 is installed, but that’s the only difference.

Code:

C#:

[DllImport(@"Wireless.dll", EntryPoint = "?cert_exists@certificate@CertFuncs@@SAHHPBD@Z", CallingConvention = CallingConvention.Cdecl)]
    static extern int cert_exists(int store, [MarshalAs(UnmanagedType.LPTStr)]string cert_str);

C++:

static int __declspec(dllexport) cert_exists(int type, LPCSTR cert_str);

Update:

If I install Visual Studio 2012 on the target machine, everything works fine. If I remove it, the application crashes again. Any ideas on what VS is adding that can make the application work?

  • 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-17T23:55:56+00:00Added an answer on June 17, 2026 at 11:55 pm

    Just a guess: install Microsoft Visual C++ 2012 Redistributable Package on the user’s machine. The native DLL you use may have other dependencies which have to be installed (try Dependency Walker). If the native DLL requires for example registry settings, config files etc. these should also be present. It should be distributed to user machines the same way you installed it on the dev machine.

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

Sidebar

Related Questions

Currently we have a WPF application being built in C# using Visual Studio 2010.
I've built an WPF application with visual studio 2008 and created an installer for
I have a WPF MVVM application. When I start Visual Studio for the first
I have built a wpf application that is using EF and SQLCE4. Everything works
I have an already built application and I want to add a feature that
I have a WPF application built with MVVM and am trying to display a
Well, the problem is as follows: I have a WPF Application built using the
I've upgraded WPF application to Visual Studio 2k8. App is .NET 3.0 which is
I have a very rich media based application built in WPF, and Im using
I have a WPF application I'm working on and the form is being built

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.