Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Unable to use custom DLL's from x++ projects

(0) ShareShare
ReportReport
Posted on by 50

Hi Team,

I'm having an issue where I'm unable to use any DLL's from my D365FO projects.  I've added a reference to the DLL in my x++ project as described in the links below but the Visual Studio development environment does not appear to be aware of the reference and behaves as though it does not exist.

- IntelliSense does not provide suggestions that should be available from the assembly.

- The compiler displays build errors that indicate it is unaware of the reference:

'TestAPI' is not declared.

The qualifier 'TestAPI.Class1' is not valid for field 'helloWorld' 

The qualifier 'TestAPI' is not valid for field 'Class1' 

Links:

https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-tools/write-business-logic 

https://www.schweda.net/blog_ax.php?bid=477&wdl=en 

https://blog.monsieurwinner.com/2022/08/30/consume-api-from-dynamics-365-finance-and-operations/ 

My environment:

D365FO dev environment v10.0.29 deployed from LCS. 

Visual Studio Professional 2019 Version 16.11.18

Microsoft .NET Framework Version 4.7.03190

My test class library:

Language:  C#

Targeting:  .Net framework 4.7

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestAPI
{
public class Class1
{
public string helloWorld()
{
return "Hello world!";
}
}
}

Other information:

The DLL exists under my \PackagesLocalDirectory\<MyModel>\bin\ directory:  C:\AOSService\PackagesLocalDirectory\<MyModel>\bin\TestAPI.dll

The XML file exists in my \PackagesLocalDirectory\<MyModel>\<MyModel>\AxReference folder.

XML file contents:

<?xml version="1.0" encoding="utf-8"?>
<AxReference xmlns:i="">www.w3.org/.../XMLSchema-instance">
<Name>TestAPI</Name>
<AssemblyName>TestAPI</AssemblyName>
<AssemblyDisplayName>TestAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</AssemblyDisplayName>
<Version>1.0.0.0</Version>
</AxReference>

I've tried the following troubleshooting tests with no success:

- Building the DLL with different target frameworks including 4.5, 4.7, .Net 5, netstandard2.0

- Adding the assembly to the GAC

- Referencing the DLL as a prebuilt DLL

- Referencing the DLL as a C# project in the same solution

Hoping that someone can tell me what I'm doing wrong and what I need to do to get it working as it should.  Please let me know if you need any additional info or want me to perform additional troubleshooting. 

Thanks,

Stuart

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans