Visual Studio/Class library wrong working directory
I have a开发者_高级运维 class library which searches for an XML file in the working directory of whichever application is consuming it.
It has worked as intended up until this point, when all of a sudden it's searching in the Visual Studio directory - C:/Program Files/Visual Studio 10/IDE/
- and thusly failing to find the file! I'm sure I've done something to cause it to do that, but I don't know what.
Does anybody know how I can resolve this, and get my library back to searching the proper directory?
EDIT: Could having a WCF service consume the dll have an effect, since the WcfSvcHost is in that directory? The dll has been consumed by WCF up to this point without this issue, however.
Whats you logic for getting the working directory? Also just as an (in)sanity check, have you tried moving the app round a few different folders to test the result?
Is it possible there is a version of your class library dll in that IDE folder that your app is picking up?
精彩评论