Exception in Tutorial 0

ZenathDark

26-07-2007 05:33:44

Hi I have made the first code example in tutorial 0 for MOGRE, and it starts up and begins initializing, but when it initializes resources it crashes. When halting the program for debugging, it gives me the message:

"Cannot evaluate expression because a native frame is on top of the call stack.".

I made it throw me the exception code, and it says:

"System.TypeLoadException: Could not load type 'Mogre.Root' from assembly 'Mogre, version=1.0.0.0, culture=neutral, PublicKeyToken=null", at MogreFramework.OgreWindow.Go().

Any suggestions to what the problem might be? I have added the references in the Project options, and modified the .cgf file to point at the OgreSDK on my harddrive. I am using MOGRE 0.2.2 , On Visual C# with the SP1, and my OS is Vista....

smernesto

26-07-2007 05:52:26

Well, I don´t know why you got ", version=1.0.0.0," in the error, have you tried to delete the references to mogre and add it again?

ZenathDark

26-07-2007 15:01:37

Yes i have tried that... :-(

But is version 1.0.0.0 the wrong version then? It is also the version number standing next to the MogreFramework.dll in the reference assembly.

I downloaded the precompiled assembly(MogreFramework.dll) file from the tutorial.

Maybe it is not up to date?

ZenathDark

26-07-2007 16:28:56

Ok, now i have reinstalled the MogreSDK, and created a new project, and now it does not generate an exception, now it just crashes at initializing resources.

After some searching in this forum, I saw someone had moved the compiled EXE to the OgreSDK/bin/release directory and it had worked, I tried the same thing and then it also worked.

Now.... What am I doing wrong here?

I have copied all the .cfg files from the C:/OgreSDK/bin/release to my projects folder/bin/relase.

I have copied all the .cfg files from the C:/OgreSDK/bin/debug to my projects folder/bin/debug.

I have copied Mogre.dll and MogreFramework.dll to both the release and debug folder in my project

In the resources.cfg in both the Relase and Debug folder in my project, I have changed the ../.. to C:/OgreSDK

In the Assembly reference in Visual C# I am referring to C:/OgreSDK/bin/release for both the Mogre.dll and the MogreFramework.dll

In the system variables, i have added C:/OgreSDK/bin/release and C:/OgreSDK/bin/debug

I must be missing something important here, but I don't know what it is.
I must be pointing or linking some files incorrectly, because the EXE file works in my C:/OgreSDK/bin/release folder.

smernesto

26-07-2007 16:31:13

Well I didn´t know what do the MogreFramework.dll but maybe is compiled for a old version of Mogre.

I got version = 0.2.2.0 for the Mogre.dll file.

smernesto

26-07-2007 16:44:29

You have to copy all .dll files.

Mogre.Dll and OgreMain.dll
The plugins for RenderSystem, etc.

Mogre.dll is a wrapper and need the Ogremain.dll and all the other .dll files.
If you are not using CEGUI you don´t need to copy CEGUI .dll files

ZenathDark

26-07-2007 17:42:38

Problem is now solved :-)

Thanks for all the help. I was not aware that the exe file required all the DLL files and plugins in its bin/release-debug folder. I don't think it says so in the tutorial or the introduction to MOGRE?

But anyway, thanks again. Now i can continue programming with MOGRE :wink: