Total Pageviews

Search This Blog

Monday, December 31, 2007

Referencing Visual Studio 2008 Assembly from AX

Steps to reference .NET Assembly (using Framework 3.5) from AX:

1. Back to Hello World times :-). Create a .NET Assembly using Project type->Class Library which will return a hello world string from VS2008.

2. Build the solution and copy the HelloWorldLibrary.dll into \ax\client\bin directory.

3. Open AOT->References and browse to add the helloworld assembly to references node.

4. Now, create a job and refer the assembly namespace and code against it.

this is the code in job:

static void JobNetFramework35(Args _args)
{
HelloWorldLibrary.Class1 oc;
str retval;
;
oc = new HelloWorldLibrary.Class1();
retval=oc.HelloWorld();
print retval;
pause;
}

and it returns as expected,

"Hello World From VS2008 using NET 3.5 framework"

No comments: