Problems with .NET 4.0

shadoslayer

06-07-2011 22:27:18

Hi everyone!
I am relatively new to Mogre, and though in the past i was able to set up the quick start application with Mogre from source for .NET 4.0, it was a huge pain in the rear and I've had to perform a hard drive reformat. I initially used the installer, however this didn't work for me, as I use VS 2010, and Mogre is compiled in .NET 2.0. every time i tried to run anything that i made, it gave me the mixed mode assembly error, telling me that I can't use that version of Mogre because it wasn't compiled in .NET 4.0. I remember having this error before, but I forget how i fixed my problem. I don't really want to go through the labor of compiling from source again(maybe im just a noob, but it took me several weeks to get it to work), and I found the enginedeps repository. which is already compiled with .NET 4.0! So to test it out, i replaced the entire bin folder of the mogre quick start with the bin found in the repository(I combined all of the Release and Debug folders from each of the libs into one folder, then copy/pasted), figuring that it would work. I figured wrong. I get the error telling me that Mogre.dll or a dependency could not be loaded(the same error I got with the quick start project before I copy/pasted the directories), and I honestly have no idea what to do, or how to make a project with this package. If someone could walk me through how to set up an application with this, I would be very appreciative, and I could get back on track with building my game. I'm really lost with this, and I'm sure there's something simple that I'm just not doing, but i have no idea what that might possibly be. :?

Beauty

08-07-2011 00:21:19

Hi shadoslayer,

welcome to the Mogre world.
I'm sad to hear that you have such heavy problems.

Thanks for your detailed report.
I don't have experience with Mogre under .NET 4.0.

User mstoyke provided precompiled binaries for .NET 4.0.
The download link is in this post.

As far as I read it's generally bad do mix binaries of 4.0 with earlier ones, because it can cause trouble.
Also I know that there is a build option in Visual Studio called ".NET 4.0 client" or similar (something with "client"). This option is important for mixed projects.
Also you should avoid to mix binaries, which are compiled by "debug" and "release" setting. (e.g. Mogre.dll as release binary and an add-on as debug version)

I hope my tiny notes could help you.

By the way:
I moved your post to a dedicated topic, because it's a more common question. So it's not hidden inside an other specific forum topic.

shadoslayer

08-07-2011 14:40:51

thanks for addressing my problems. Yeah, when I try to use precompiled binaries, VS likes to give me an error stating that an operation Mogre.dll was trying to load could not be loaded, or something like that. I have a feeling that this is because I simply copied/pasted the binaries into the correct folders in my project, but I'm not exactly sure what other way it could be done. as for the setting in VS for ".NET 4.0 client", I couldn't find it, and I searched the internet for quite a while, and the consensus is that it can't really be done, using .NET 2.0 with .NET 4.0. the only way that i currently see to fix my problem is to build Mogre from source, as then I can simply compile it in VS2010. So how would you go about using these precompiled binaries? there must be something simple that I'm missing, as they work for other people.

Beauty

08-07-2011 23:13:03

I read that problems can happen when mixing binaries which are compiled by different versions of Visual Studio.
Even mixing VS2010 with VS2010_SP1 can cause trouble.
I don't know if this is just related to some special cases. I just want to let you know.

Dropping and linking the binaries to your project generally should work.

What you can do?
Perhaps try use the .NET 4.0 binaries to run a low complex test application.
For example run the Mogre Tutorial 1.
The needed Tutorial Framework is available for VS2010 / .NET 4.0 here.
If this works fine, then you know that it generally works.
If it fails, you know it's not related to your project. (Are there different depencies for .NET 4.0 Mogre??)

shadoslayer

12-07-2011 19:43:44

I tried running the quickstart application as is, and that didn't run, and I'm fairly sure it's not related to my project, as it compiled and ran the previous time that I had Mogre installed from source, before I had to reformat my hard drive. The only changes were that I re-added the references to Mogre because the location of the Mogre install had changed, and that I tried to use the installer/precompiled binaries. as for the dependencies, I do not believe that there are any different dependencies, as I do not remember downloading anything extra previously, but I could very well be wrong.

Kwang1imsa

13-07-2011 02:55:25

I've been using Mogre and .NET 4.0 as well and have experienced no problems whatsoever. Are you using the release binaries?

Beauty

16-07-2011 00:21:29

I got a notice about an other .NET 4.0 build, which you can try.

Unofficial, unsupported, use at your own risk, may contain traces of nuts:
Mogre 1.7.3
.NET 4.0 / release config