3

We are currently using a third party DLL, that looks for a license file in the working directory of the application. When the code is run out of a typical C# application, the DLL is able to pick up the license file located in the same directory (\bin\). When an ASP.NET application is running that same code under IIS, it fails due to licensing issues. The only work around we have found has to place the license file in Windows\System32\inetsrv.

It seems as though the DLL is referencing the license file using a simple file.open("*.lic*);, and because IIS is using inetsrv as the working directory (https://stackoverflow.com/a/16485227/693671), it simply looks there. Is there any way to change the working directory of an IIS application?

Community
  • 1
  • 1
Tim
  • 1,334
  • 2
  • 15
  • 29
  • Have you tried simply changing working directory with code before using the library? – Alexei Levenkov Apr 14 '15 at 19:12
  • This seems more like a licensing problem than an IIS working directory problem. Have you contacted the company to see if their product is licensed this way? – crthompson Apr 14 '15 at 19:13
  • Alexei, we have not tried this yet. In a normal C# application this would likely work, but due to ASP.NET spawning and destroying the controllers based on requests, odd behavior might occur. We will try it regardless, and report back. – Tim Apr 14 '15 at 19:40
  • When we dynamically change the working directory to a different folder containing the license file, it works. However, this still seems somewhat ugly, as it requires an extra deployment step. Changing it manually to the IIS temporary code folder seems feasible, but is still somewhat "hacky". – Tim Apr 15 '15 at 13:26

0 Answers0