3 Replies Latest reply on Sep 6, 2011 11:04 AM by CFnewbie2011

    CF9 & .Net framework 4 integration

    Jo Corless Level 1

      I have a very simple .Net class that I've converted to a dll file and am calling from my coldfusion code - On CF 9 it was informing me that my

       

      "class not found in the specified assembly list.The assembly that contains the class must be provided to the assembly attribute."

       

      Which according to my CFObject call it is

       

      <cfobject type = ".NET"
                        name = "hmlrDotNetComms"
                        class = "uk.co.etsos.LandRegDotNetComms"
                        assembly = "C:\Net\Assemblies\LandRegDotNetComms.dll">
                        <cfset hmlrDotNetComms.init()/>   
                        <cfset httpResponse = hmlrDotNetComms.HMLRSendOrder(variables.authQ.userName,variables.authQ.Password,orderXml, serviceName)>

       

       

      So I had a look around the net and it appeared that my problem was because I hadn't upgraded to CF 9.01 but following that upgrade - I'm now getting the following error - I've restarted the .Net integration service as well as reboot my machine - makes no difference - Any clues?

       

       

      "Error","web-0","10/07/10","14:10:59",,"DotNet Side does not seem to be running.Ensure that the DotNet agent is running and you have provided the correct host and port information The specific sequence of files included or processed is: C:\ColdFusion9\wwwroot\LandRegistryDirect\test\TestSearchByPropertyDesc.cfm, line: 108 "
      coldfusion.runtime.dotnet.DotNetServerAgent$DotNetSideNotRunningException: DotNet Side does not seem to be running.
          at coldfusion.runtime.dotnet.DotNetServerAgent.setCurrent(DotNetServerAgent.java:30)
          at coldfusion.runtime.dotnet.ProxyGenerator.getAssemblyPath(ProxyGenerator.java:451)
          at coldfusion.runtime.dotnet.ProxyGenerator.getDependentClasses(ProxyGenerator.java:207)
          at coldfusion.runtime.dotnet.Assembly.generateProxy(Assembly.java:269)
          at coldfusion.runtime.dotnet.Assembly.loadClass(Assembly.java:250)
          at coldfusion.runtime.dotnet.Assembly.loadClass(Assembly.java:225)
          at coldfusion.runtime.dotnet.DotNetProxyFactory.getProxy(DotNetProxyFactory.java:78)
          at coldfusion.runtime.ProxyFactory.getProxy(ProxyFactory.java:65)
          at coldfusion.runtime.CFPage.createObjectProxy(CFPage.java:5002)
          at coldfusion.tagext.lang.ObjectTag.doStartTag(ObjectTag.java:427)
          at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)

        • 1. Re: CF9 & .Net framework 4 integration
          MediaStorm

          When you upgraded to 9.01, did you also run the .CF NET integration installer to update the .NET CF components?

           

          If not, try uninstalling the old CF .NET integration and reinstalling with the new version released with 9.01.

          • 2. Re: CF9 & .Net framework 4 integration
            Jo Corless Level 1

            Thank you - that seems to have fixed the problem - Atleast CF can see the assembly now - however I'm still getting an error

             

            coldfusion.runtime.dotnet.ProxyGenerationException
                 at coldfusion.runtime.dotnet.ProxyGenerator._executeProxyGen(ProxyGenerator.java:192)
                 at coldfusion.runtime.dotnet.ProxyGenerator.executeProxyGen(ProxyGenerator.java:149)
                 at coldfusion.runtime.dotnet.ProxyGenerator.generateProxy(ProxyGenerator.java:118)
                 at coldfusion.runtime.dotnet.Assembly.generateProxy(Assembly.java:299)
                 at coldfusion.runtime.dotnet.Assembly.loadClass(Assembly.java:250)
                 at coldfusion.runtime.dotnet.Assembly.loadClass(Assembly.java:225)
                 at coldfusion.runtime.dotnet.DotNetProxyFactory.getProxy(DotNetProxyFactory.java:78)
                 at coldfusion.runtime.ProxyFactory.getProxy(ProxyFactory.java:65)
                 at coldfusion.runtime.CFPage.createObjectProxy(CFPage.java:5002)
                 at coldfusion.tagext.lang.ObjectTag.doStartTag(ObjectTag.java:427)
                 at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)


            This is currently the simplest of classes - I'm trying to get the integration working before I do anything fancy

            .Net code

            using System;
            using System.Collections.Generic;
            using System.Linq;
            using System.Text;

            namespace uk.co.etsos
            {
                public class LandRegDotNetComms
                {
                    public string HMLRSendOrder(string username, string password, string xmlBody, string serviceName)
                    {
                        string m_Username = username;
                        string m_Password = password;

                        return "This should be a soap response";
                    }
                }
            }

             

            Coldfusion 9 Code:

             

            <cfobject type = ".NET"
                              name = "hmlrDotNetComms"
                              class = "uk.co.etsos.LandRegDotNetComms"
                              assembly = "C:\Net\Assemblies\LandRegDotNetComms.dll">
                              <cfset hmlrDotNetComms.init()/>   
                              <cfset httpResponse = hmlrDotNetComms.HMLRSendOrder(variables.authQ.userName,variables.authQ.Password,orderXml, serviceName)>

             

            I've compiled the code in Visual Studio Express 2010 and put the compiled dll plus the associated config file in the assemblies directory - however it just throws the about error - I'm assuming I've done something wrong with assembling the dll ?

             

            My knowledge of .Net is very limited but as we can't get a connection to this damm funky webservice using Coldfusion or Java - I'm left with no choice - so any help is very much appreciated

            • 3. Re: CF9 & .Net framework 4 integration
              CFnewbie2011

              I have the same problem ... I got the latest version 9.0.1 and I keep getting "coldfusion.runtime.dotnet.ProxyGenerationException" no matter what I try ... even the simplest PING example from Adobe site generates this error:

               

              <!--- This function pings the specified host. --->
              <cffunction name="Ping" returntype="string" output="false">
                  <cfargument name="host" type="string" required="yes">
                 
                  <!--- Local variables --->
                  <cfset var pingClass="">
                  <cfset var pingReply="">
                 
                  <!--- Get Ping class --->
                  <cfobject type=".NET" name="pingClass" class="System.Net.NetworkInformation.Ping">

               

                  <!--- Perform synchronous ping (using defaults) ---> 
                  <cfset pingReply=pingClass.Send(Arguments.host)>
                 
                  <!--- Return result --->
                  <!-- <cfreturn pingReply.Get_Status().ToString()> -->
                  <cfreturn pingReply.Status.ToString()>

               

              </cffunction>

              <h3>Ping Test</h3>
              <cfoutput>
                  localohost PING Status: #Ping("127.0.0.1")#<br>
              </cfoutput>