Reputation: 427
I created a console application to import "C" Dll using DllImport The "C" Dll has reference to other Dll's and Config files in same folder.
When i put all the files in bin directory of Console applicaiton it works perfect.
But when i create a Web application to consume the same it does not work. (The dll reference are fine when i set the path, but it seems the config files are not getting loaded)
I have tried below but did not help.
None seem to work, Any other suggestions?
Upvotes: 0
Views: 1144
Reputation: 427
I solved the issue.
I used Directory.SetCurrentDirectory();
to set the path of the dll's and config files.
if its not possible to change the current directory. Place the files in path Directory.GetCurrentDirectory();
Upvotes: 1
Reputation: 7932
You'll need to move the configuration into the web.config file for the web application There's some good advice on how to do that here: Custom section/collection in Web.Config
Upvotes: 0