How to use DLL with Ax 2012

1.open visual studio 2010 create a new C# project in that open class library write the following code

using System.Text;

namespace AXCS

{

public class TestingMyDLL1

{

public string Greet(string name)

{

return “Hello ” + name;

}

}

}

2.Bulid the solution

3.go visualstudio projects—> copy dll files

4.program files(X84)–>microsoft dynamics—>client—>bin—> paste    Dll files

5.open AOT–>go referencess —>.add reference–> add that dll files

6.Go to jobs–> Add new job write that following code

static void John_DllTest(Args _args)
{
JohnTestClassLibrary.TestingMyDLL1 testingDll;

InteropPermission permission;

str s;

try

{

permission = new InteropPermission(InteropKind::DllInterop);

permission.assert();

testingDll = new JohnTestClassLibrary.TestingMyDLL1();

s = testingDll.Greet(“Johnkrish The Great”);

info(s);

}

catch

{

error(‘Error executing DLL code’);

}

}