Asp.net调用C#层调用托管C ++调用本机C ++ [英] Asp.net calling C# layer calling Managed C++ calling Native C++

查看:169
本文介绍了Asp.net调用C#层调用托管C ++调用本机C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目结构如下:

ASP.NET 调用 C#层调用的管理 C ++调用的本地 C ++
(我试图避免使用互操作,所以这是为什么托管C ++层)
我写单元测试测试C#层和它工作正常。
当我尝试运行asp.net页面我得到:无法加载文件或程序......错误。
我想通了,当我复制粘贴在本机C ++ DLL为临时ASP.NET文件(到相应的文件夹)的网站的作品。

ASP.NET calling C# layer calling Managed C++ calling Native C++ (i'm trying to avoid using interop so this is why the managed c++ layer) I wrote unit test that test the C# layer and it works fine. When I try to run the asp.net page i'm getting: "Could not load file or assembly..." error. I figured out that when i copy paste the Native C++ dll to "Temporary ASP.NET Files" (to the corresponding folder) the site works.

看来,在托管C ++ code可以找到在本机C ++ code,只有当它驻留在同一文件夹 - 显然我不能有我的本机DLL中的临时文件。

It seems that the Managed C++ code can find the Native C++ code only if it resides in the same folder - obviously I can't have my Native dll in the temp files.

有没有办法来设置在全球发生的自然(不System32下工作)?

Is there a way to set the Native in a global place(doesn't work with System32)?

感谢您的意见。


  1. 这是安全问题

我成立了以code服务器时,它自身并卡西尼号下运行,但是当我发布(下IIS7运行)我得到无法加载文件或程序......
我正在用IIS7 ApplicationPoolIdentity,.NET 4集成
非常感谢,
皮尼。

i set up the server it self with the code and it runs under the cassini, but when i publish it(to run under iis7) i'm getting "Could not load file or assembly ...." i'm running IIS7 with ApplicationPoolIdentity , .net 4 Integrated Thanks a lot, Pini.

推荐答案

我只好翻在ApplicationPoolIdentity一个布尔值。其中一个在属性提起写着让32位,而没有的伎俩:)默认值为False
我的服务器是64位的,我建我的32位本地人。

I had to flip a bool in the ApplicationPoolIdentity. One of the filed in the properties says "enable 32bit" and that did the trick :) the default is False My server is 64bit and i build my native with 32bit.

这篇关于Asp.net调用C#层调用托管C ++调用本机C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆