Can't load "resources.cfg"

hnamletran

15-04-2013 16:54:32

Hi all,
I was trying to create Mogre window inside a panel in C#. I copy necessary dlls and cfg to bin/Release (where my binaries are), and copy media to project folder as well. Everything was fine, I could run Mogre in my application. Suddenly, I could not get it anymore after some modification, which I don't remember.

It seems that Mogre can't regconise the project folder and bin/Release folder. For example, when I tried to load resources.cfg:

try
{
cf.Load("C:/Proj/Game/trunk/GameApp/bin/Release/resources.cfg", "\t:=", true);
}
catch (Exception e)
{
Console.WriteLine("Exception:!!! " + e.Message);
}


It did not throw any exceptions. But if I replace the absolute path with "resource.cfg" alone, it threw exception:
04/15 12:25:47.774 : Log Started

04/15 12:29:33.208 :
Error Message: External component has thrown an exception.

If I use absolute path, I would have modify the content of the resources.cfg file to contain only absolute paths too.. but then Mogre won't able to detect rendering systems, and etc. etc.

May someone show me how I can let mogre know that it should look into the bin/Release folder for everything? Thank you for reading my long question.

hnamletran

16-04-2013 08:46:19

Hi guys,
I found the problem, it was because someone set Curernt Directory to other directory. All I need to do is call:


Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);