I am trying to instantiate and call methods on a .net object created from a dll from coldfusion. This works when I call methods with one or zero argument, but with an error -
System.MissingMethodException: Could not find a common method coldfusion2net.test.setvars
when I try to call a method with several arguments.
Here is my simple C # class:
namespace coldfusion2net { public class test { protected string myvar; protected string myvar2; public void setvars(string v, string v2) { myvar = v; myvar2 = v2; } public void setvar(string v) { myvar = v; } public string getvar(){ return myvar; } } }
and here is my ColdFusion test:
<cfset dll = ExpandPath('./coldfusion2net.dll')> <cfobject type=".NET" name="test" class="coldfusion2net.test" assembly="#dll#"> <cfset test.init()> <cfdump var="#test#"> <cfset test.setvar("foo")> <cfset s = test.getvar()> <cfoutput>#s#</cfoutput> <cfset test.setvars("foo","bar")>
To compile the dll, I use visual studio 2010, oriented to the .net 3.5 runtime environment (which is what our servers have). I am using ColdFusion 8,0,0,176276 to try to load the DLL.
Has anyone else seen something like this? Am I doing something wrong? Is this a CF error?
I looked at an article about Adobe Live documents on .NET compatibility restrictions, but the closest I found is "ColdFusion cannot determine the correct data type conversion if the method has several signatures that have the same number of parameters and differ only in parameter data types " This does not seem to be a problem.
Nick van brunt
source share