Can't locate public static method

Posted by acf on 2010-10-31 16:55
Forums: PDK discussion | OS: Windows

My first attempt at integrating some existing .Net c# code with Perl has left me a little stumped.
When my perl test stub is built and run, I get an error as follows:
Can't locate public static method OpenConnection() for Cibis.DBHelper.SqlDB

This is with the following line in the Perl stub: use PerlNET qw(AUTOCALL);
If I comment out that line, the error message is as follows:
Can't locate object method "OpenConnection" via package "SqlDB" (perhaps you forgot to load "SqlDB"?) at (eval 10)

The Perl stub code is:

use namespace "System";
use namespace "System.Data";
use namespace "Cibis.DBHelper";

# use PerlNET qw(AUTOCALL);

my $dbc = Cibis::DBHelper::SqlDB->new('connection_string_here');
my $open_str = "$dbc->OpenConnection()";
eval($open_str);
print "evaluating the Return from OpenConnection gave $@\n";

The class definiton for the method I am trying to call is as follows:

namespace Cibis.DBHelper
{
        /// <summary>
        /// Sql Server Specific Implementation of the DB Base Class
        /// </summary>
        public class SqlDB : DB
        {
           ....

While the classes from which it derives are declared as follows:

namespace Cibis.DBHelper
{
        /// <summary>
        /// Abstract Base Class based upon the IDB Interface
        /// </summary>
        public abstract class DB : IDB, IDisposable
        {
           ....

and

namespace Cibis.DBHelper
{
        /// <summary>
        /// Represents a Database Helper. Encapsulates the minimum functionality
        /// that any Database Helper class should implement.
        /// </summary>
        interface IDB
        {
                void OpenConnection();
                ....

The dll built from the c# code is in the current PDK library and it has been added to the module search path (probably unnecessarily), and I have explicitly added the Cibis.DBHelper.dll to the referenced files via the PDK UI

Any help greatly appreciated.