Failed loading assemblies

Hello,

I’m trying to integrate AyaNova 5 with Microsoft Dynamics AX 4.0. I currently have Ayanova and AX installed on the same machine using SQL Server 2005 which is also running on the same machine. I have registered the assemblies per the instructions on the Microsoft support site. I can make calls to all of the assemblies except for two:

GZTW.AyaNova.BLL and GZTW.WinForm.Controls.

The error messages are below:

Failed loading assembly GZTW.AyaNova.BLL, Version=5.0.5.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL

Failed loading assembly GZTW.WinForm.Controls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL

Is there any reason that I could call the other assemblies but not these two? I believe that GZTW.AyaNova.BLL is the assembly that I need to access the data in Ayanova from within an AX program.

Thanks

berlblack (8/27/2009)Hello,

I’m trying to integrate AyaNova 5 with Microsoft Dynamics AX 4.0. I currently have Ayanova and AX installed on the same machine using SQL Server 2005 which is also running on the same machine. I have registered the assemblies per the instructions on the Microsoft support site. I can make calls to all of the assemblies except for two:

GZTW.AyaNova.BLL and GZTW.WinForm.Controls.

The error messages are below:

Failed loading assembly GZTW.AyaNova.BLL, Version=5.0.5.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL

Failed loading assembly GZTW.WinForm.Controls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=df66a8d8e49833d3, processorArchitecture=MSIL

Is there any reason that I could call the other assemblies but not these two? I believe that GZTW.AyaNova.BLL is the assembly that I need to access the data in Ayanova from within an AX program.

Thanks

Hi. The only AyaNova assembly you need to work with directly is the business object library which is in GZTW.AyaNova.BLL. You should be making no calls to any other assemblies provided with AyaNova.

I’m a bit mystified why your app is loading GZTW.WinForm.Controls as that is entirely related to the AyaNova windows program UI level and is only called by AyaNova itself for some extended controls it uses in the windows interface. It’s got nothing to do with business objects at all. You should have no need to ever call that assembly as your app will provide the UI and in fact it’s technically not legal for you to call that assembly because it has some extensions to 3rd party controls we license that you would need a developer license from those 3rd parties to use in any case.

The api docs list the exact assemblies you need to reference in a .net development environment.

That being said if AyaNova is installed through it’s installer on that computer and is confirmed running (i.e. you can login from that AyaNova and access the database) then there is no simple reason why any calls to the business object library should fail. If they work for AyaNova they will work for your own application provided it references and calls them suitably.

I’m not familiar with Dynamics AX so I can’t speak to that side of it right away but I might be able to put my Google-Fu to work if I can narrow down what you’re doing.

Perhaps if you can tell me what you’re doing, i.e. are you attempting to use AyaNova business objects from within Dynamics somehow (does it have a scripting or development environment built into it?) or are you attempting to marry the two together through a separate application by calling ours and Dynamics API’s in your own application developed outside of Dynamics?

Do you have a snippet of source code that is failing? Have you tried the example code we provide with the API that shows the required calls that must be made to initiate the connection etc?

Essentially whatever your environment you need to replicate the bare minimum code shown in the samples for the API.

I see some references to Dynamics calling .net assemblies so I’m guessing that a) you can write code in Dynamics and b) it is possible to call the AyaNova assemblies, however there is a strange lack of actual detail on how to do this in the hits I’m getting back from Google so more information would be helpful.

Cheers!

I know that GZTW.AyaNova.BLL is the only assembly that I should need. I only tried the others to see if I could call them, which I could except for the two that I mentioned.

The programming language in Dynamics AX is X++. You can call an assembly directly from an X++ program as long as the reference is set up.

It seems that the program is finding the assembly but having a problem loading it. If I remove the reference I get a different error than when it is there.

Here’s a simple sample that will not compile:

public class aisTestAyanova

{

GZTW.AyaNova.BLL        ayanova;

}

There is some documentation here on loading assemblies in AX:

http://msdn.microsoft.com/en-us/library/bb986586(AX.10).aspx

Hopefully you can see something that I missed.

Thanks

It seems that perhaps one thing is missing, I came across this:

http://simon.butcher.name/archives/2007/02/22/Using-SOAP-via-a-.NET-in-Dynamics-AX

Which seems to indicate you can’t call a .net assembly until you explicitly tell AX to allow it with the interopPermission.

Also on that page he specifies that AX can only load an assembly from the GAC. I’m surprised at this requirement and guess it’s not entirely true for it would be very limiting, however if it is the case you can of course copy the required AyaNova biz object and support .dll’s to the GAC though it would be a manual step and need to be changed for every update (which is why we don’t use the GAC). Better by far to find a way to call assemblies not in the GAC in AX if it’s an issue.

Since you said you had no problem loading other AyaNova assemblies perhaps location is not an issue after all.

So I’m guessing that either it’s not loading due to the lack of permission or not loading because it can’t find it.

Unfortunately, none of these are the case. AX is definitely finding the assembly but having a problem loading it for some reason.

I’m going to look into registering the assembly as a COM object and see if that works.

I do find it a little suspicious that there is so little info on working with .net assemblies from Dynamics AX, though it appears to be a relatively new feature they added. Some of the links I came across were about fixing problems that arise trying to do this and some surprising Type incompatibilities so I’m guessing it might be a little rough around the edges but they will improve it over time.

Normally though with most development environments it’s a trouble free process, there are a lot of people that use the AyaNova API from all manner of different environments.

Please keep us up to date, I’d like to know what it turns out to be and I’m sure someone else in future will want to try this.