Writing a .NET dll that Jade can use

Forums for specific tips, techniques and example code
User avatar
justin
Posts: 7
Joined: Tue Apr 22, 2014 1:22 pm
Location: Nelson, New Zealand

Writing a .NET dll that Jade can use

Postby justin » Thu Jun 12, 2014 1:12 pm

I am trying to write a DLL in C#.NET that Jade can use (External Function or the like) but I can't seem to get it to work, and cannot find anything in the Jade docs about. All the Jade docs seem to be the other way round (i.e. Using .NET and calling Jade).
I can get it as far as actually reading the DLL but fails and comes back with 'function not found in assembly'? At this stage I just want to call one method in the .NET assembly, not sure if it should be an instance object or a static for Jade?

Anyone have an experience with this?
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ” - Edsger Dijkstra

Justin

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: Writing a .NET dll that Jade can use

Postby JohnP » Thu Jun 12, 2014 1:52 pm

Are you importing the .Net assembly? This is done with Browse>External Component Libraries. See Maintaining .NET Objects in UserGuide.pdf.

User avatar
justin
Posts: 7
Joined: Tue Apr 22, 2014 1:22 pm
Location: Nelson, New Zealand

Re: Writing a .NET dll that Jade can use

Postby justin » Thu Jun 12, 2014 3:12 pm

Yeah I think the issue I was having was thinking that .NET was an External Function or External Method call, I didn't realize that Jade actually imports them. I eventually came across the same doc, just going to give it a whirl now but looks straight forward.

Cheers
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ” - Edsger Dijkstra

Justin

User avatar
justin
Posts: 7
Joined: Tue Apr 22, 2014 1:22 pm
Location: Nelson, New Zealand

Re: Writing a .NET dll that Jade can use

Postby justin » Fri Jun 13, 2014 9:13 am

OK, now I've got an interesting situation. The server that I would like to get the .NET assembly imported into,does not have .NET framework installed. Jade throws a bit of a harsh error, would have been nice if it just said .NET framework not installed as it took me a little bit to figure out what was going on.

Now I have since installed .NET, but I am still getting the same error.

Any idea as to how refresh jade to now see the .NET framework?

Its a server so doing a restart may be difficult
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ” - Edsger Dijkstra

Justin

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Writing a .NET dll that Jade can use

Postby BeeJay » Fri Jun 13, 2014 9:23 am

For importing .Net dlls, I normally use one of the following two approaches:

1. Use a local copy of the target system to do the import. Then use the extract option on the External Components Browser to extract the component definition to a schema file. Finally, us my normal thin client connection to load the extract into the main development environment.

2. Run a standard client connection, often called a "fat client" connection, instead of a thin client connection on my local machine to do the import into the main development environment.

Both approaches avoid any issues with missing libraries etc on the server machine if this component is only ever going to be used on the thin client machines. If you're going to use the component on the server itself, then you do need to get all the additional dependencies for .Net installed on the server anyway so it's worth persevering with getting everything installed onto the server. I normally use approach #1 as I nearly always have a recent enough local copy of the development environment on my own local machine. :)

Hope that helps,
BeeJay.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 15 guests

cron