Debugging = Current Working Directory (1 Viewer)

jeoffh

New Member
July 18, 2008
2
0
Home Country
United States of America United States of America
just got MediaPortal to compile in my VS2005 (pro) environment - fairly easy to do. I wanted to tinker with the Configuration app so I set the MediaPortal.Configuration project as the "StartUp Project". When I run in debug mode I was getting "DirectoryNotFoundException" during the launch. It ends up the app couldn't find my "language" folder, the "Music DSP" dll, etc. Long story short, the lookup routines for "language" LocalisationProvider.GetAvailableLangauges searches for the "language" folder in my "bin\Debug" (where the exe is running from as opposed to my "current working directory". The folder for searching for "language" is set via "Config.GetFolder(Config.Dir.Language);" which is initialized with "AppDomain.CurrentDomain.BaseDirectory" (which is my bin\Debug) folder.

Next, my hack: change AppDomain.CurrentDomain.BaseDirectory to "Directory.GetCurrentDirectory()" in “Config.cs”. In fact, as I look around in the source there are a variety of ways that directory/paths are initialized all over the place: MusicDSP for example, uses “Application.StartupPath”, which is similar to AppDomain.CurrentDomain.BaseDirectory. I changed a few of these (where I was getting exceptions) to “Directory.GetCurrentDirectory()” and everything is working in Debug Mode (F5) as long as I set my Debug setting “Working Directory:” (project settings) to be “<MyBasePath>\trunk\mediaportal\MediaPortal.Base\”

So... Instead of using my hack, how am I supposed to be running Configuration.exe in debug mode then? I usually just hit "F5" in the IDE and start debugging, as is my habit. But this cannot work unless the config EXE is moved into the folder where all the required files are – it seems that MediaPortal.Base is the place. How are you guys debugging this beast?
 

Doron

MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Home Country
    Israel Israel
    I have the same problem.
    Did you find an answer?

    Actually, looks like it is solved by just setting the output directory to be "<your path>\mediaportal\xbmc\bin\debug\"
     

    jeoffh

    New Member
    July 18, 2008
    2
    0
    Home Country
    United States of America United States of America
    I'm not sure if you can call it a bug, but these various setting should be consistent. Pick BaseDirectory, StartupPath, or GetCurrentDirectory and stick with that through all the occurrences.
     

    Users who are viewing this thread

    Top Bottom