web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to include a C/C++...
Finance forum

How to include a C/C++ DLL which is not .NET in a Dynamics D365 Operations Project?

(0) ShareShare
ReportReport
Posted on by

Hello,

I have to include a third party C/C++ DLL which is not .NET in a Dynamics D365 Operations Project. How can I do this?

I tried to create an own dll which includes the third party DLL in C++ with Visual Studio. For creating my own DLL I chosed Win32 Console Application with the application type DLL. When I want to inlcude my own DLL into my project I get an error message saying: "File ....dll is not a valid .NET assembly. This file will note be added as a reference."

I think I have to create a .NET dll, but how can I do this?

Does anyone got a good documentation on how to include third party DLLs?

I have the same question (0)
  • Community Member Profile Picture
    on at

    When I try to add the third party DLL in a own C# DLL I get a error message saying: "A reference to 'C:\....dll' could not be added. Please make sure that the file is accesible, and that it is a valid assembly or COM component."

  • Verified answer
    Srini Ramidi Profile Picture
    2 on at

    Hello,

    To use an unmanaged dll (native C++) in C#, you have to use DllImport or PInvoke, not by adding a reference to the project in visual studio. Refer these:

    msdn.microsoft.com/.../system.runtime.interopservices.dllimportattribute(v=vs.90).aspx

    clrinterop.codeplex.com/.../14120

    Best,

    Srini

  • Community Member Profile Picture
    on at

    Hello Srinivas,

    Thank you very much for your answer. This is the solution!

    Regards,

    Kai

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans