C# Extern delphi dll在windows server 2012上不工作
我们在ASP.NET MVC4 C#应用程序中使用的Delphi编写的extern DLL存在问题。奇怪的是,DLL工作正常,在开发人员机器上返回字符串列表,但当我们把它放在web服务器上时,它并没有返回任何东西 在本地,我们使用的是:IIS 7、ASP.NET 4.0、Windows 7.5、SQL Server 2008 R2C# Extern delphi dll在windows server 2012上不工作,c#,asp.net,delphi,dll,windows-server-2012,C#,Asp.net,Delphi,Dll,Windows Server 2012,我们在ASP.NET MVC4 C#应用程序中使用的Delphi编写的extern DLL存在问题。奇怪的是,DLL工作正常,在开发人员机器上返回字符串列表,但当我们把它放在web服务器上时,它并没有返回任何东西 在本地,我们使用的是:IIS 7、ASP.NET 4.0、Windows 7.5、SQL Server 2008 R2 在我们使用的web上:IIS 8、ASP.NET 4.0、Windows server 2012、SQL server 2008 R2 代码如下: [DllImpor
在我们使用的web上:IIS 8、ASP.NET 4.0、Windows server 2012、SQL server 2008 R2 代码如下:
[DllImport("C:\\EMSStructureSearch\\BL\\DLL\\StructureHandler.dll")]
public static extern int StructureSearch(byte[] NamelessParameter1, StringBuilder NamelessParameter2, int NamelessParameter3);
public ActionResult AdvStructureSearch(string query, string exactsearch, string stereo,GridDescriptor request)
{
System.Web.HttpContext.Current.Session["AdvancedSearchFilter"] = null;
var tmp = BreadcrumbNavigationGetSet();
AdvSearchFiltersAll filters = new AdvSearchFiltersAll();
if (filters.StructureSearch == null)
{
filters.StructureSearch = new AdvStructureSearch();
}
filters.StructureSearch.Query = query;
filters.StructureSearch.Exactsearch = exactsearch;
filters.StructureSearch.Stereo = stereo;
filters = BreadcrumbNavigationGetSet(filters);
StringBuilder sb = new StringBuilder(524288);
byte[] bytesData = Encoding.ASCII.GetBytes("query=" + query + ";exactsearch=" + exactsearch + ";stereo=" + stereo + "\0");
int result= StructureSearch(bytesData, sb, sb.Capacity);
string recordIds = sb.Replace(";",",").ToString().Trim().TrimEnd(',');
您是否已经检查了dll文件属性,如果它由于安全原因被阻止,因为它是从网络上传的?被阻止的文件在第一个属性选项卡上显示一个标记为“取消阻止”的按钮。是的,我已经检查了DLL文件属性。没关系。接下来要检查的是:32位与64位:您是否尝试让站点的应用程序池在32位上运行?我们的应用程序只能在64位上运行,但DLL也是64位的。请尝试一些调试。找出一些有意义的信息。DLL正在加载吗?如果函数被调用?调用函数时,函数内部会发生什么?因此,只需要基本的第一个调试步骤。