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?