Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling C# from ColdFusion

I've written a .dll in C# to change the permissions on a folder. I also wrote an .exe to test the .dll and it successfully changes the permissions. Now I'm trying to call the .dll from ColdFusion, but I'm getting an error about System/Security/IPermission not being found.

I'm assuming this is an interface in C# that ColdFusion can't find in any of the available assemblies on my system. I've added the System.Security assembly to my References in the C# project. Is there something else I need to do to make sure ColdFusion can find the interface?

Here's how I'm using the .dll:

<cfobject type="dotnet" name="permObj" assembly="#pathToDLLs#CoursePortal.dll" class="CoursePortal.Permissions">
<cfset permObj.revokePermissions(dir, username)>
like image 426
stomcavage Avatar asked Oct 15 '22 07:10

stomcavage


1 Answers

I never could get it to work. I switched the DLL to an EXE and used <cfexecute> to call it. It's working fine now. The .NET code is called so infrequently it doesn't make much difference that it's a separate app.

like image 164
stomcavage Avatar answered Oct 18 '22 21:10

stomcavage