Sunday, October 19, 2014

Calling .Net assembly function into ColdFusion ( Also known as Runtime Unification)

Lets explore .Net into ColdFusion. Very interesting thing which i learn as a ColdFusion beginner.

Step-1:  Create web application project using Visual studio and add class  as given below

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

namespace MyFirstLibrary
{
    public class MyFirstClass
    {
        public int Add(int a, int b)
        {
            return a + b;
        }
    }
}

After build application, it creates MyFirstLibrary.dll. under debug folder.

(Remember ColdFusion .Net Service has to be started)

Step-2: Add assembly list into D:\ColdFusion10\cfusion\jnbridge\JBNDotNetSide.exe.config file as shown below

<assemblyList>
    <assembly file="E:\Pankaj\ColdFusion\TEST\MyFirstLibrary\MyFirstLibrary\bin\Debug\MyFirstLibrary.dll"/>

</assemblyList>   



Step-3: Add .cfml page  and paste below code.

<cfobject type=".NET"  name="Math" class="MyFirstLibrary.MyFirstClass" assembly="MyFirstLibrary.dll" >
<cfset result=Math.Add(4,4)>
<cfoutput>
#result#
</cfoutput>
<cfdump var="#Math#">



Run .cfml page into browser and check amazing thing.... result appears on your browser.

Wow....

for more details:
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-789c.html



Wednesday, October 9, 2013

Welcome to ColdFusion Beginner

Hi Guys,

I got great opportunity to learn ColdFusion . so, i thought to add some topics which are required to hands on it.


Looking forward with your support.