从ASP调用后端.net dll.. NET Web api
Call backend .NET dll from ASP.NET Web api
我正在构建客户端服务器应用程序。
业务逻辑是用c++/CLI构建的。在同一个溶液中,我有ASP。. NET Web api项目。
对于登录,我在后端有方法。对于登录,我需要这样做
using Back_End;
public IHttpActionResult Logon([FromBody]Logon_Request model)
{
string Answer = Back_End.Logon(model.Name, model.Password);
}
Back_End在相同的解决方案中位于dll内部。
当我尝试调用api/logon时,它返回一个异常。
{
"Message": "An error has occurred.",
"ExceptionMessage": "Could not load file or assembly 'Back_End, Version=1.0.5676.23091, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019)",
"ExceptionType": "System.IO.FileLoadException",
"StackTrace": ".........."
}
当然,因为它不在IIS服务器上。
最后我的问题:
-但是我需要在服务器上部署所有的业务逻辑dll吗?
-乳清在这里起作用吗?
-有"更好"的方法来做我想做的吗?
-也许我需要把它作为一项服务来使用并打电话?但它将是API的API
Web。配置文件
<compilation debug="true" targetFramework="yourTargetFramework">
<assemblies>
<add assembly="yourAssemblyName, Version=yourAssemblyVersion, Culture=neutral, PublicKeyToken=yourPublicKeyToken" />
</assemblies>
</compilation>
登录。aspx页
<%@ Register Assembly="yourAssemblyName, Version=yourAssemblyVersion, Culture=neutral, PublicKeyToken=yourPublicKeyToken" Namespace=".dll Namespace" TagPrefix="name to call the loginUserControl" %>
交货。
...TagPrefix="rs" %>
<rs:Login/>
相关文章:
- 用于将C++代码转换为 Web 程序集的脚本未终止
- 在 C++/CLI 中将 .NET 事件从一个 DLL 引发到另一个 DLL
- 如何在 64 位 vb.net Windows 应用程序中引用 32 位 dll
- 加载与引用 .NET DLL 位于同一文件夹中的引用的 .NET DLL 时"Not found"异常
- C# DLL 从C++应用程序调用 SOAP Web 服务
- 是否可以在Linux上使用.Net Core 3.1创建C++/CLI代码的C#DLL
- OpenCV(C++)处理来自JavaScript / Web Assembly的图像数据
- Poco::Net::FTPClientSession 在 open() 方法上挂起 129 秒,如果 ftp 主机不存
- C++ DLL(不是 CLI)是否可以调用 .NET Core 3.0 委托?
- BlackBerry 10 Cascades致电ASP.NET Web服务
- 将 c# asp.net Web 应用程序与C++ dll 链接时,是在服务器或客户端上运行的 dll 代码
- 是否有一个类似于.NET框架的基于C++的DebianLinux web应用程序框架
- 我可以在ASP.NET web应用程序中使用未编译的C++代码吗
- 在web服务器和.net中的windows应用程序之间进行通信的方法
- 如何为c++代码创建一个dll(在树形程序中使用大量指针),以便在ASP. js中引用它.Net Web应用程序
- 安全库的ASP.. NET web应用程序
- 从ASP调用后端.net dll.. NET Web api
- 如何在不混淆的情况下监视.NET web浏览器控件上的用户操作
- VB.NET中开发的Web服务未选择更新的DLL
- 调试.net web应用程序中的bad_alloc异常