Last post Feb 27, 2017 03:54 PM by mgebhard
Feb 27, 2017 09:24 AM|Lydecker7|LINK
I have written a webservice which references 2 DLL files. These 2 DLL files are located on the IIS server's C: drive that the webservice is being run from. The DLL files are provided by another company and I do not have the rights to 'include' them in my
bin file - I only have permission from the company to reference them where they reside on the C drive.
I have therefore set the 'Copy Local' property for each of the Referenced DLLs to 'False' in my project. However now when I run the webservice I obviously get a:
'Could not load file or assembly .... The system cannot find the file specified.' error.
If I move the two DLL files to the bin file, the webservice runs fine - however as mentioned I can't do that. How to a specify a reference path telling the webservice to look at C:\ to find the location of the DLLs? (I know how to set a reference path for
a console application or Forms application - just not a web one).
I have searched hi and low online, but can't find a solution.
Using VS2015 - .Net v4
Feb 27, 2017 09:43 AM|raju dasa|LINK
Check this site to set probing path for assemblies, may help you:
Feb 27, 2017 09:51 AM|Lydecker7|LINK
Thanks for the reply, however probing only works for paths that are sub-directories of the application base directory as stated in the link you provided:
The directories specified in privatePath must be subdirectories of the application base directory
Probing won't help if the dll files reside outside of the application directory.
Feb 27, 2017 10:21 AM|raju dasa|LINK
Try dynamically load of assembly:
or ask client for suggestion, explaining your obstacles.
Feb 27, 2017 03:54 PM|mgebhard|LINK
Try exposing the dll through COM+ or install the assembly in the GAC