【发布时间】:2015-10-07 07:21:23
【问题描述】:
我正在构建客户端服务器应用程序。
业务逻辑在 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 for API。
【问题讨论】:
-
将程序集/ .dll 添加到您的 Web 配置文件和 Login.aspx 的标记代码或包含登录信息的任何文件中。
-
谢谢。你能说得更具体一点吗?在哪里,什么以及如何。我是 web api 的新手。 :)
标签: c# c++ asp.net visual-studio asp.net-web-api