# Identify / change working directory for the InstallableNET runtime

I am currently attempting to use .NET/link to call a third party DLL from Mathematica using DLLDefinedFunction. I have been able to link against and call many of the functions in the DLL, but have encountered issues with one function in particular, which attempts to read in data from a file whose path is hard-coded relative to the current working directory.

Forgive my ignorance, but as I am not "au fait" with .NET, I don't know how to determine what InstallableNET32.exe is using as its working directory, or how to change it to something else. (I do know how to change the working directory for the MathKernel, but based on my experimentation, any changes to the kernel's working directory do not appear to "flow through" to the InstallableNET runtime.)

Could someone please provide guidance on how I can identify, and then change, the working directory being used by the InstallableNET runtime (Is this an example of another undocumented feature in .NET/link, like the "Force32Bit"->True option?)

-

I googled ".net change working directory", and this link to Microsoft's .NET docs was the first hit: http://msdn.microsoft.com/en-us/library/system.io.directory.setcurrentdirectory(v=vs.110).aspx. It would suggest the following:

LoadNETType["System.IO.Directory"]
DirectorySetCurrentDirectory["c:\\foo"]


To find out the current working directory:

DirectoryGetCurrentDirectory[]

-
Todd: Thanks, this works. I had tried something similar, but was attempting to load "System.IO" only. I did say I wasn't at all familiar with .NET ... ;-) –  Confused-cius Dec 18 '13 at 18:09