Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/129.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# C++;从WCF服务应用程序调用的DLL在IIS 8中部署时不工作? < >我用DLIMPORT调用C++ DLL。代码位于从WCF服务应用程序调用的类库项目中 [DllImport(dllPath, SetLastError=true)] public static extern IntPtr CDSEngineConstructor(); [DllImport(dllPath, SetLastError=true)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool InitialiseDSEngine(StringBuilder pSB, IntPtr pDSEngine, StringBuilder pName, [MarshalAs(UnmanagedType.LPArray)] string[] ppListToLoad, UInt32 usiNumber);_C#_C++_Wcf_Iis_Dll - Fatal编程技术网

C# C++;从WCF服务应用程序调用的DLL在IIS 8中部署时不工作? < >我用DLIMPORT调用C++ DLL。代码位于从WCF服务应用程序调用的类库项目中 [DllImport(dllPath, SetLastError=true)] public static extern IntPtr CDSEngineConstructor(); [DllImport(dllPath, SetLastError=true)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool InitialiseDSEngine(StringBuilder pSB, IntPtr pDSEngine, StringBuilder pName, [MarshalAs(UnmanagedType.LPArray)] string[] ppListToLoad, UInt32 usiNumber);

C# C++;从WCF服务应用程序调用的DLL在IIS 8中部署时不工作? < >我用DLIMPORT调用C++ DLL。代码位于从WCF服务应用程序调用的类库项目中 [DllImport(dllPath, SetLastError=true)] public static extern IntPtr CDSEngineConstructor(); [DllImport(dllPath, SetLastError=true)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool InitialiseDSEngine(StringBuilder pSB, IntPtr pDSEngine, StringBuilder pName, [MarshalAs(UnmanagedType.LPArray)] string[] ppListToLoad, UInt32 usiNumber);,c#,c++,wcf,iis,dll,C#,C++,Wcf,Iis,Dll,成功调用dll的构造函数后,我得到一个IntPtr IntPtr pEngine = CDSEngineConstructor(); 我使用上面的值作为参数来调用dll中的另一个初始化方法 if (!InitialiseDSEngine(sb, pEngine, sbReportingName, lstTyping.ToArray(), 10)) throw new Exception("Failded to initilaise the search engine.

成功调用dll的构造函数后,我得到一个IntPtr

IntPtr pEngine = CDSEngineConstructor();
我使用上面的值作为参数来调用dll中的另一个初始化方法

if (!InitialiseDSEngine(sb, pEngine, sbReportingName, lstTyping.ToArray(), 10))
        throw new Exception("Failded to initilaise the search engine. please check the logs")
编辑:未创建日志文件

在VS2008 development server中运行WCF时,上述方法运行良好。但是在IIS8中部署相同的方法后,上面的方法返回false,这意味着它无法初始化,我无法继续

DLL是在x86中以发布模式构建的。我的类库项目也是使用相同的活动配置构建的

我也尝试在服务器中安装C++可重分配2008。IIS设置为运行32位应用程序

我无法找到这种行为的解决方案和原因。查询相同的内容将返回未加载dll的结果。但在这种情况下,我能够正确加载dll


如果我遗漏了任何信息,请告诉我。

您能添加一些代码并在此处显示内容而不是截图而是内联文本吗?@Hayt我已按您的要求编辑了问题您能添加一些代码并在此处显示内容而不是截图而是内联文本吗?@Hayt我已按您的要求编辑了问题