Got*_*ode 10 c# asp.net dll asp.net-mvc
我的ASP.NET MVC应用程序使用用C++编写的非托管外部DLL.
这个网站在Visual Studio中运行良好,正确定位和访问外部DLL.但是,当网站发布在本地Web服务器(运行IIS 7.5)而不是Visual Studio IIS Express时,我收到以下错误:
HTTP Error 503. The service is unavailable.
Run Code Online (Sandbox Code Playgroud)
外部DLL位于网站的bin目录中.看了IIS日志,我注意到每次调用dll时defaultapppool都会停止.
HTTP/1.1 GET /Bio/Select/3 503 1 Disabled DefaultAppPool
Run Code Online (Sandbox Code Playgroud)
我尝试过以下方法:
下面是我如何调用dll的代码片段
[HttpGet]
public ActionResult Select(int ID)
{
int res = BSSDK.BS_InitSDK();
if (res != BSSDK.BS_SUCCESS)
{
ModelState.AddModelError("Error", "SDK failed to initialise");
}
return View()
}
public class BSSDK
{
[DllImport("BS_SDK.dll",
CharSet = CharSet.Ansi,
EntryPoint = "BS_InitSDK")]
public static extern int BS_InitSDK();
}
Run Code Online (Sandbox Code Playgroud)
我的看法
@model IEnumerable<BasicSuprema.Models.BioUser>
@using GridMvc.Html
@{
ViewBag.Title = "Bio Users On DB";
}
<div class="well well-sm"><h3>@ViewBag.Title</h3></div>
@Html.ValidationMessage("Error")
<div class="grid-wrap">
@Html.Grid(Model).Named("UsersGrid").Columns(columns =>
{
columns.Add(c => c.BioUserID).Titled("ID");
columns.Add(c => c.UserName).Titled("User");
}).WithPaging(10).Sortable(true)
</div>
Run Code Online (Sandbox Code Playgroud)
类似的问题包括无法在ASP.NET服务器上加载非托管DLL 如何在ASP.NET网站中调用非托管代码并将其托管在IIS中
当我在运行IIS 8的Web服务器上托管它时,我得到以下错误.所以可能在我的本地IIS服务器上它返回错误503因为它找不到dll但我还没有确定这个托管的我没有访问权限将dll复制到系统文件夹.
Unable to load DLL 'BS_SDK.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1205 次 |
| 最近记录: |