0

Currently I'm having an ASP.NET api site, using a group of 3rd party dlls, while running in unit test is fine, in w3wp it is not.

(Edit: these dlls are referenced by one of my module projects, which is dynamically loaded by my ASP site when launching. So I just dump all these 3rd party dlls into the ASP site bin folder, it worked fine for other modules with other 3rd party dlls)

After debugging through decompiled code, I found out that one of the dll is using Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) dynamically loading some other dlls.

Except that, instead of my website bin folder, it gets a location located in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\my_asp_project\... where the dll is all by itself.

Is there a way I can avoid this without modifying the dlls?

Jiqnpqn
  • 13
  • 4
  • Possible duplicate of [Best way to get application folder path](https://stackoverflow.com/questions/6041332/best-way-to-get-application-folder-path) – Manoj Choudhari Feb 01 '19 at 18:06
  • @ManojChoudhari : no, the code used to get application folder path is from 3rd party dll, I don't want to modify that. – Jiqnpqn Feb 01 '19 at 19:32
  • If the third party DLL uses Asembly.GetExecutingAssembly().Location - i believe it might not have been intended for ASP.Net usage as per description given on that other thread. – Manoj Choudhari Feb 01 '19 at 21:31

0 Answers0