The Trouble with CF8's .NET Integration

I have an opportunity to take on a project that involves replacing as ASP/AJAX front-end with a Flex front end. The back-end uses .NET Objects, so with CF8's new .NET integration feature, it seems like it should be simple to use CF8 as a middleware to connect directly to the .NET objects I need and then using Flex Remoting

[More]

Comments
Martin Pitt's Gravatar There a a couple of great solutions out there for .NET / Flex remoting, specifically WebOrb (http://www.themidnightcoders.com/weborb), and the open source equivilant, FluorineFx ( http://www.fluorinefx.com/ ).

Both have support for exactly what you're after, as well as support for the RTMP protocol (though this is more mature in WebOrb than Fluorine at the moment).

Addmitadly, I haven't ever tried the CF approach, (or ever used CF), so I can't offer any insight into the differences.

However, I highly reccomend both of these products, which I've used both extensively.
# Posted By Martin Pitt | 1/6/08 8:07 PM
Charlie K.'s Gravatar Previously, I was developing CF code on BlueDragon, so .NET integration was a piece of cake...but now, I'm working with Adobe folks, so ColdFusion 8 is the app-server of choice.

We need to be able to integrate with NTLM and Active Directory. Using BlueDragon, it was a simple as <Cfset user = #System.Security.Principal#>

Anybody doing anything like this with CF8 and .NET interop?
# Posted By Charlie K. | 1/29/08 10:49 AM
James Wood's Gravatar I too have been frustrated with trying to get the integration to work. We have successfully called and .NET class and returned a query result. BUT, this is only when we have a hard coded connection string. We didn't seem to have to have "strongly named" .dll.

When we try to use the connection string that is defined in the web.config file we get an error that "The ConnectionString property has not been initialized"

If you have any further results then I would be very interested to know what you found.
# Posted By James Wood | 2/6/08 12:50 PM
Kevin Huth's Gravatar First, thanks for the blog!

I've also been trying to get the integration to work. I'm trying to use the System.Messaging dll to write to the Mircosoft Messaging Queue (MSMQ). I can't seem to get CF to find this dll.

I get the following:

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

When I try to add the assembly attribute (on my server the path is C:\WINNT\assembly\System.Messaging.dll), it says it cannot find it. But I don't think that is really where it live because doing a file search in Windows Explore also won't return an results when searching for the above file in the WINNT directory.

I've also tried to add this assembly using the jnbproxyGui.exe, but it seems to not allow me to build the project.

Any ideas?
# Posted By Kevin Huth | 2/6/08 3:14 PM
James Wood's Gravatar Hi

This is something that I have used to find out the locations of the .dlls

http://www.aisto.com/roeder/dotnet/

It is the Reflector for .NET. A very useful tool for traversing through a dll and finding the classes.

Hope it helps
# Posted By James Wood | 2/6/08 3:19 PM
rafael's Gravatar hi

i made an example on how to use .net + coldfusion... i hope it helps

(it encrypts a string with a Rijndael algorithm 256 bit)

<cfobject type=".NET" name="myRijndael" class="System.Security.Cryptography.RijndaelManaged" assembly="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Security.dll">
<cfobject type=".NET" name="myConvert" class="System.Convert" assembly="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll">
<cfobject type=".NET" name="myCipher" class="System.Security.Cryptography.CipherMode" assembly="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Security.dll">
<cfobject type=".NET" name="myEncoding" class="System.Text.UnicodeEncoding" assembly="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll">

<cfscript>
str = "hello";
key = "vXPlTT0bI2Bd2zPwW2sqRRAn8TQ8YmV/iC4+qQgzeNY=";
myRijndael.Set_Key(myConvert.FromBase64String(key));
myRijndael.Set_Mode(myCipher.ECB);

encryptor = myRijndael.CreateEncryptor();
data = myEncoding.GetBytes(str);
dataEncrypted = encryptor.TransformFinalBlock(data, 0, myEncoding.GetByteCount(str));
returnString = myConvert.ToBase64String(dataEncrypted);
</cfscript>
# Posted By rafael | 8/23/08 12:31 PM
Copyright ©2007 JimPickering.com. Some rights reserved. BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.