Problem with CREATE on Custom Automation

matttraxmatttrax Member Posts: 2,309
This is my first attempt at building a custom .NET (C#) automation. I've tested the functionality from within Visual Studio and it works as intended.

I was able to compile the code into a dll file just fine. I've successfully registered it using regasm and added it to the global cache using gacutil. When I create an automation variable in Navision I can see my object and have no problems. I see the methods I want from within the symbol menu and everything looks great. Everything saves and compiles.

Then I get to CREATE(NavAutomation) and it blows up. Cannot create an instance of GUID ****. I compared the GUID to what I found in Visual Studio for my project and it was the same, just in case I screwed something up there.

I don't understand what's wrong. Usually it will say "Unknown" or something when you look at variables and it can't find the automation. Any ideas? I'll post the code if need be. Thanks.

Answers

  • kinekine Member Posts: 12,562
    You can use the Visual Studio to debug the creation process. Just set the fin.exe or finsql.exe as application to start during debug of your project, after the NAV was started, just set breakpoints in the constructor in your dll and run the object in NAV. :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,256
    Here is a howto create .NET dll in nav

    http://msdn.microsoft.com/en-us/library/aa973247.aspx
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • matttraxmatttrax Member Posts: 2,309
    Figured it out. Didn't have a default constructor in there, which I guess CREATE was expecting. With only a constructor to take in parameters it was not happy.

    It's been so long since I did OOP. But at least it works now. My first automation is done, and although simple, it's kind of nice getting to do something a little different.

    Thanks for your help.
  • kinekine Member Posts: 12,562
    matttrax wrote:
    Figured it out. Didn't have a default constructor in there, which I guess CREATE was expecting. With only a constructor to take in parameters it was not happy.

    It's been so long since I did OOP. But at least it works now. My first automation is done, and although simple, it's kind of nice getting to do something a little different.

    Thanks for your help.

    Yes, it is new, be prepared to be hooked on it... if you once started to use VS and do something there, it is hard to leave it... :-)

    If you know how to make the DLLs, you have new space where you can search for solutions...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.