sto*_*age 5 .net c# coldfusion
我在C#中编写了一个.dll来更改文件夹的权限.我还写了一个.exe来测试.dll,它成功地更改了权限.现在我试图从ColdFusion调用.dll,但是我收到一个关于System/Security/IPermission未找到的错误.
我假设这是C#中的一个接口,ColdFusion在我的系统上的任何可用程序集中都找不到.我已将System.Security程序集添加到C#项目中的References中.我还需要做些什么才能确保ColdFusion能够找到界面吗?
这是我使用.dll的方式:
<cfobject type="dotnet" name="permObj" assembly="#pathToDLLs#CoursePortal.dll" class="CoursePortal.Permissions">
<cfset permObj.revokePermissions(dir, username)>
Run Code Online (Sandbox Code Playgroud)
我永远无法让它发挥作用。我将 DLL 切换为 EXE 并使用 <cfexecute> 来调用它。现在运行良好。.NET 代码很少被调用,因此它是一个单独的应用程序并没有太大区别。