c# - Call backend .NET dll from ASP.NET Web api -


i building client server app.

the business logic build in c++ /cli. in same solution have asp.net web api project.

for logon have method in backend. logon need this

using back_end; public ihttpactionresult logon([frombody]logon_request model) {  string answer = back_end.logon(model.name, model.password); } 

back_end inside of dll in same solution.

when try call api/logon retunes me exception.

{ "message": "an error has occurred.", "exceptionmessage": "could not load file or assembly 'back_end, version=1.0.5676.23091, culture=neutral, publickeytoken=null' or 1 of dependencies. attempt load unverifiable executable fixups (iat more 2 sections or tls section.) (exception hresult: 0x80131019)", "exceptiontype": "system.io.fileloadexception", "stacktrace": ".........." } 

of course, because not on iis server.

finally questions:

-but need deploy business logic dll on server?

-will whey work here?

-is "better" way want?

-maybe need sun service , make calls? api api.

web.config file

<compilation debug="true" targetframework="yourtargetframework">       <assemblies>         <add assembly="yourassemblyname, version=yourassemblyversion, culture=neutral, publickeytoken=yourpublickeytoken" />       </assemblies> </compilation> 

login.aspx page

<%@ register assembly="yourassemblyname, version=yourassemblyversion, culture=neutral, publickeytoken=yourpublickeytoken" namespace=".dll namespace" tagprefix="name call loginusercontrol" %> 

ex.

...tagprefix="rs" %>

<rs:login/>


Comments