struggling adding an External .NET Resource

Posted by KenWalsh on 06-May-2010 15:14

I am new to using the OpenEdge Architect, and I am attempting to take advantage of the new 10.2B .NET controls.

I have created very simple C# .NET 2.0 class and made it a dll. I have used this in a C# win32 app to make sure it works. I then loaded up the Architect, accessed the Class Browser, added an External Resource, via the Local Assemblies. The Class Browser show the new Class, with all appropriate constructors, methods, and properties. However when I attempt to define a variable as that class type, it does not recognize the class.

USING AssetTestDLL.AssetTest.
DEFINE VARIABLE class1 AS CLASS  AssetTest.
class1 = NEW AssetTest().

The Using line fails unless it is:

USING AssetTestDLL.AssetTest.*.

The define I cannot get working. In the Class library, the Namespace is AssetTestDLL, and the class is AssetTest.

Thanks,

Ken

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/AssetTest.dll.zip:550:0]

All Replies

Posted by Peter Judge on 06-May-2010 15:21

Where does the DLL live? Is it in the GAC? Or the project root in Architect*?

[update] I should have been clearer: the OE compiler/runtime needs assemblies (DLLs) that aren't in the GAC to be in the folder referenced by -assemblies.

-- peter

  • technically, the folder referenced by the -assemblies parameter but usually the project root.

Posted by KenWalsh on 06-May-2010 15:28

The DLL lives in the project root in Architect.  How do I set the -assemblies option?

Thanks,

Ken

Posted by KenWalsh on 06-May-2010 15:34

Thank you so much for the assembly information. I found the assembly setting under project --> Properties then OpenEdge --> Assemblies. Once I added the dll to this list it compiled, and all my functions are now available. I added the -assemblies to the PF and the code is running perfectly.

Thanks,

Ken

Posted by Peter Judge on 06-May-2010 15:41

Excellent. I was just double-checking here, but if you add an assembly in the Class Browser, it doesn't get added to the/a project's assemblies (ie it's just for information). You need to add the assembly to the Project's references.

-- peter

This thread is closed