weird problem when calling OpenResource. OSMLoader


18-08-2008 07:02:38

here is the c# code

XmlDocument xd = new XmlDocument();
DataStreamPtr dsp = ResourceGroupManager.Singleton.OpenResource(xmlFile);

it will crash at "ResourceGroupManager.Singleton.OpenResource(xmlFile);"
xmlFile is "21.osm" and I'm sure it exists in the resource group since I have check it by the following code

if (ResourceGroupManager.Singleton.ResourceExists(

All the related files including ".mesh", ".material" and ".tga" are in the same folder.

more information:
1. I have tried to list out all the resource names and all the resource files by "ResourceGroupManager.Singleton.FindResourceNames" and "FindResourceFileInfo" but got nothing.
2. Actually, all the code menthioned above origins from the "OSMLoader" which is a .NET port of oFusion Scene Loader. Here is the related thread:
3. I have checked the log file and got this:
"13:58:03: oSceneLoader: Loading '21.osm' file
13:58:03: OGRE EXCEPTION(6:FileNotFoundException): Cannot open file: 21.osm in FileSystemArchive::open at ..\src\OgreFileSystem.cpp (line 211)"
4. Other resources like texture or particle system work well and all of them including "21.osm" are in the same folder.

I have worked on this issue more then 2 days and don't know how to make any progress now. Can anybody help me?