c# - COMException CreateInstance failed on publish -
i'm developing c# webapi project references third-party api dll. component simple com reference added visual studio project.
web api published on intranet server (iis) integrated security & user impersonation turned on, anonymous auth turned off.
when running web api in visual studio (2015) on local machine, works perfectly.
when running published web api on our iis server, works fine, when send request controller action uses third party library, receive following error:
system.runtime.interopservices.comexception
additional information:
createinstance failed.
@ thirdpartylib.connect()
the third party dependency installed on server (as dev machine) using installer. registered set of dll's , installed accompanying software. have verified correct installation. in fact, simple winforms application using same dll works fine.
process monitor shows w3wp.exe using correct dll.
i'm not sure i'm missing?
if rights problem, how go solving it?
you can change application pool identity user higher permissions.
note: can use asp.net impersonation using web config run whole application specific identity or using code run part of code using specific identity. example tested <identity impersonate="true" username="r.aghaei" password="mypassword"/>
file system permission , worked properly. pay attention impersonation in webconfig or in code, works if application pool user have sufficient rights allow impersonation. more information how use impersonation inn config or code see this msdn kb article.
also don't neglect least privilege principal.
Comments
Post a Comment