dynamicsaxadmin icon indicating copy to clipboard operation
dynamicsaxadmin copied to clipboard

Failing build with C# VS 2013 Project

Open laserpez opened this issue 6 years ago • 3 comments

Hello, I'm using this project to automate builds for AX2012 R3 on TFS 2015. As far as I understand included Visual Studio C# Projects - once they are added to the AOT and to TFS repository - will be compiled by the build mechanism and no other steps should be necessary to make the resulting DLL “visible” to the X++ code. Is this statement correct?

I’m asking this because it seems that C# projects are not automatically compiled, thus causing compiling errors on X++ code: \Classes\FAB_CustomerVerification\verifyCustomersActivity, line 3, column 5 : Variable FAB_CrifIntegrationV2 has not been declared.

This is the verifyCustomersActivity code:

public void verifyCustomersActivity(Set customersToBeVerified)
{
    FAB_CrifIntegrationV2.ServiceReference.SearchClient searchClient;
    FAB_CrifIntegrationV2.ServiceReference.CompanySearchData searchData = new FAB_CrifIntegrationV2.ServiceReference.CompanySearchData();
    FAB_CrifIntegrationV2.ServiceReference.InquiryCompanyDetails inquiryDetails;
    FAB_CrifIntegrationV2.ServiceReference.CompanyItem[] companyList;
    FAB_CrifIntegrationV2.ServiceReference.CompanyItem item;
                …

while the object declared are defined in FAB_CrifIntegrationV2 C# project, included in the AOT and the correct model (I'm using VS 2013). I also wrote a job that executes that method and it works correctly if executed both on client side or server side.

Please, could you point out my mistake or suggest checks that could fix the issue?

Thank you in advance for any help/suggestion.

laserpez avatar Feb 28 '19 16:02 laserpez

Try setting the CodeCrib.Build.AOTCompilePaths build pipeline variable to an array (PowerShell notation) of the projects you need to compile.

@('\Visual Studio Projects\C Sharp Projects\abc_Project','\Visual Studio Projects\C Sharp Projects\SRSDrillThroughCommon','\Visual Studio Projects\C Sharp Projects\xyz_Report.BusinessLogic')

This compiles the VS projects using the ax32 client prior to building everything with axbuild. It's a bit of a holdover from previous versions where it had to run these compiles in a specific layer to successfully save the build output back to the AOT in the right place. Now axbuild offers a layer parameter to run in a specific layer, but the build libraries don't use that option yet.

dan-we avatar Feb 28 '19 16:02 dan-we

Sorry @dan-we , where do I set that variable? in the process XAML?

laserpez avatar Mar 01 '19 14:03 laserpez

For a XAML build, it's a parameter on the build definition named AOT nodes to compile (no changes needed in the build process template XAML file). It's a TFS string list type so you can enter multiple AOT paths using the ... button.

dan-we avatar Mar 01 '19 17:03 dan-we