Problem with Automation with C# Dll
 
            
                
                    ombacke                
                
                    Member Posts: 44                
            
                        
            
                    Hi,
I wrote some code in C/Side where I point to a C# dll through automation. Calling the dll works fine. You can call mehods on it and all.
So when I import the navision object and i import it agai n another installation the call to the dll doesnot work anymore. It says that it can't find the automation server or something like that...
To make it work i need to get in the code and reset the link to the dll.
Is there a way not to have to do all that???
Thanks
                I wrote some code in C/Side where I point to a C# dll through automation. Calling the dll works fine. You can call mehods on it and all.
So when I import the navision object and i import it agai n another installation the call to the dll doesnot work anymore. It says that it can't find the automation server or something like that...
To make it work i need to get in the code and reset the link to the dll.
Is there a way not to have to do all that???
Thanks
0                
            Comments
- 
            The dll itself must be present and registered on the client machine for Navision to be able to work. The principle is the same as trying to open a Word document without having Word installed. If the Navision code works on your machine, then the dll is registered there. If the same code does not work on another machine, all you need to do is register it on that machine and the Navision code should work right away.
 There is no way around having to register the dll. I remember someone posting a way to store the dll inside the Navision database and registering it dynamically, but I don't know how that works exactly, or if that would work on a .NET assembly.0
- 
            Register the dll i.e Copy the dll onto the new client machines' HDD, and go into command prompt. cd into the dir with the dll, and run "regsvr32 dllname.dll", where dllname is the name of your dll. You should get a msg saying reg was done succesfully. Now you can proceed!$cside -MBS
 >install Navision::4.0 SP1
 >q
 $
 oOo0
- 
            To use automatic registration of COM controls use ClickOnce that comes with .NET.0
- 
            But if the dll u register ust be the same version as the dll you compiled and iported the object with??0
- 
            In .NET you have
 [assembly: Guid("xxxx-xxxx-xxxx-xxxx-xxxx")]
 [assembly: AssemblyVersion("1.0.0.0")]
 Navision only sees Guid. If you change AssemblyVersion but keep untouched the Guid there is no problem with Navision.0
- 
            How do ou assign the GUID or where do you get the GUID from???
 Also i have another question. When I register the dll. After i come back, unregister it. Then i regiser a new version of the dll... Now when i go to the code unit to choose a dll, I have the dll twice in the list.. With one of the dlls with no classes..... Is that normal??? Does Navision keep in memory old dlls??0
- 
            GUID is in a file in the project, normally in the AssemblyInfo.cs. The creation of the guid is automatic with the project.
 Reasons to appear the same DDL twice (just guessing…)
 You have register the same DLL with to different GUID
 You have unregistered de DLL but DLL was still in use I Navision or in another program.0
- 
            If you do not use GUID and Strong name for your DLL, each build of the dll will be registered as another version and Navision will lost the connection to this DLL (you will need to select it once more...).
 ANd of course, you need to install this dll on each PC, where the Navision will use this dll...
 The registration process is not done through regsvr32, it is done through RegAsm.exe0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions



