Error using .dlls

Topics: User Forum
Feb 13, 2007 at 3:37 AM
Could not load type 'Animation.ModelAnimator' from assembly 'Animation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

thats the error i'm getting trying to run the tutorial using the latest .dlls. I'll trying using the source files...

~Jonathan
Feb 13, 2007 at 3:40 AM
ok, it works fine using source code but the .dlls don't work.
Coordinator
Feb 13, 2007 at 4:15 AM
The Animation.Content dll has to be in the same directory as Animation.dll because it is a dependency. Does that fix it?
Feb 13, 2007 at 4:41 AM
it was... Animation.dll and Animation.Content.dll were both in the root directory with the classes and such. I loaded Animation.dll with the Add Reference and Animation.Content.dll with the Framework as specified in tutorial. I even then tried loading them both with both ways of loading the dlls. nothing worked though.
Coordinator
Feb 13, 2007 at 5:11 AM
Edited Feb 13, 2007 at 5:15 AM
Hmm... I even just downloaded the dlls, made a new project, and tested it out.

And the dlls are version 1.0.0.5
Coordinator
Feb 14, 2007 at 1:04 AM
I made a mistake in compiling them. Can you please try the newly posted dlls?
Feb 14, 2007 at 2:33 AM
I downloaded the starred link and copied the zip contents over the other files and recompiled but still have the same problem described above.

Error 1 The type or namespace name 'ModelAnimator' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\SamJew\My Documents\Visual Studio 2005\Projects\WindowsGame2\WindowsGame2\Game1.cs 64 9 WindowsGame2

ModelAnimation, ModelAnimationBuilder, ModelAnimationCollection, ModelAnimationInfo, but no ModelAnimator.
Feb 14, 2007 at 2:43 AM
Could not load type 'Animation.ModelAnimator' from assembly 'Animation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

still got same error. it is appearing to be trying to load the 1.0 compile as opposed to the 1.0.05.
Coordinator
Feb 14, 2007 at 2:52 AM
Edited Feb 14, 2007 at 2:56 AM
Ok....

I just find it odd that you two are getting different errors, but they both seem to indicate using an older version of the dlls.

When you look at the dlls in windows explorer and/or in visual C# express, does it say that they are version 1.0.0.5?

I can't see how this is even possible, since I keep making completely new projects to make sure they work.
Coordinator
Feb 14, 2007 at 3:05 AM
Well, I purged the obj and bin directories in the project and rebuilt, and the Animation.dll size changed by 4 kilobytes, so something is funky.

I posted the new dlls up. Could you test them one last time :)
Feb 14, 2007 at 3:37 AM
So far as I can tell, they're the same. Same file size and everything. 65,536 bytes and 57,344 byte respectively. Same problem... Maybe for the next version label them 1.0.0.6 or something so we know they're changed? If someone can tell me how to make a .dll, I can perhaps try compiling it on my machine and see if that works any better for people?
Coordinator
Feb 14, 2007 at 3:47 AM
Edited Feb 14, 2007 at 3:54 AM

dastle wrote:
So far as I can tell, they're the same. Same file size and everything. 65,536 bytes and 57,344 byte respectively. Same problem... Maybe for the next version label them 1.0.0.6 or something so we know they're changed? If someone can tell me how to make a .dll, I can perhaps try compiling it on my machine and see if that works any better for people?


Could you try that please :)
Just follow the directions in the compilation info wiki linked off the front page. Since you create a Windows Game Library project, simply compiling the project will make a DLL in the ./<projectdir>/bin/debug/ directory.

A release build is preferred but for now, whatever works. You can build a release by changing the dropdown menu in the middle of the top toolbar to Release.

Meanwhile, I'll disassemble the dlls and look at the byte code to see whats going on.
Feb 14, 2007 at 3:58 AM
In the interim, I've been adding all the files to my project manually and seeing if that works.


This line in CheckForInvalidData() of ModelAnimator.cs

gives the following error:

Unable to cast object of type 'Animation.ModelAnimationCollection' to type 'Animation.AnimationInfoCollection' at the following line:

animations = (AnimationInfoCollection)modelTagData"Animations";

Don't know why it doesn't like that cast. If I add the files in the Contnet folder as well, I get a bunch of errors along the following lines:

Error 3 The type or namespace name 'Pipeline' does not exist in the namespace 'Microsoft.Xna.Framework.Content' (are you missing an assembly reference?) C:\Documents and Settings\SamJew\My Documents\Visual Studio 2005\Projects\WindowsGame2\WindowsGame2\AnimatedModelProcessor.cs 28 39 WindowsGame2

Missing an assembly reference for all of them?

Anyway, I'll see if I can't create the first .dll I've ever created in my life now. (or maybe I already have and just didn't know about it?)
Feb 14, 2007 at 4:05 AM
69,632 bytes for the created .dll which I renamed Animation. Could be promising. Cross your fingers...
Coordinator
Feb 14, 2007 at 4:08 AM
Oh, you need to more than what I said to make the assemblies. You need to edit the properties file and also rename the dll through the project.. let me update the wiki real quick.
Feb 14, 2007 at 4:38 AM
Edited Feb 14, 2007 at 4:50 AM
Hmmm... Animation.dll 1.0.0.6 is created as advertised. Animation.Content.dll generates a string of error messages:


Error 1 The type or namespace name 'Pipeline' does not exist in the namespace 'Microsoft.Xna.Framework.Content' (are you missing an assembly reference?) C:\Documents and Settings\SamJew\My Documents\Visual Studio 2005\Projects\WindowsGameLibrary4\WindowsGameLibrary4\AnimatedModelProcessor.cs 28 39 WindowsGameLibrary4

Error 2 The type or namespace name 'Pipeline' does not exist in the namespace 'Microsoft.Xna.Framework.Content' (are you missing an assembly reference?) C:\Documents and Settings\SamJew\My Documents\Visual Studio 2005\Projects\WindowsGameLibrary4\WindowsGameLibrary4\AnimatedModelProcessor.cs 29 39 WindowsGameLibrary4

Error 11 The type or namespace name 'Xml' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Documents and Settings\SamJew\My Documents\Visual Studio 2005\Projects\WindowsGameLibrary4\WindowsGameLibrary4\AnimatedModelProcessor.cs 39 14 WindowsGameLibrary4

...etc...

I'm putting everything in the same directory when attempting to build Animation.Content.dll. That wouldn't be the problem, would it? Since one of the error messages is relating to not being able to find the Xml functionality in System, I fear it may be something more fundamental. Any ideas? All 136 of these error messages are asking me if I'm missing a using directive or assembly reference. What could it be?
Coordinator
Feb 14, 2007 at 4:45 AM
Forgot a line in the wiki:
Add Microsoft.Xna.Framework.Content.Pipeline and System.Xml as references to the second project

I also updated the wiki as I said early to tell you how to correctly set the assembly name and version.

Someone did just post in another thread saying they got the dlls to work, so I don't know what's going on.
Coordinator
Feb 14, 2007 at 4:48 AM
Also, the byte code indicates that ModelAnimator exists. So perhaps it is a cache problem and you just need to create a new project.
Feb 14, 2007 at 5:01 AM
Sorry, I'm a n00b at all this. Not very conversant with project settings and so forth. Build engineering baffles me and while I know what a makefile is and what it's for, I couldn't actually write one with a gun to my head. I'm sure my frustration must be palpable and I aplogize for that. But what you just said did do the trick! Thank you!!!

Got the .dll. Now to test it.... fingers crossed
Feb 14, 2007 at 5:38 AM
w00t!! Finally works as advertised, even with the downloaded .dlls. Thank you so much for holding my hand through all this. I guess it was simply a matter of building a new project instead of trying to bolt this stuff onto an old one.
Coordinator
Feb 14, 2007 at 5:39 AM
I also just tried something new, which is uploading the file that gets copied to the second projects output.

Want to try the uploaded dlls one more time before sending me yours (if it works)?
Coordinator
Feb 14, 2007 at 5:45 AM
Edited Feb 14, 2007 at 5:46 AM
np, I'm just not looking forward to the build engineering for the xbox. I made it work half a month ago or so by tricking the Animation.Content.dll into thinking it was building for another assembly.

Also, can you confirm that the dlls i JUST uploaded still work in a new project? I used the Animation.dll that was copied into the dependency directory, so I just want to make sure it works on other comps.
Feb 14, 2007 at 5:31 PM
I just downloaded the dlls and they worked fine for the two first tutorials 'getting started' and 'rendering the ground and the dwarf'...Im now trying the third one
Feb 14, 2007 at 9:21 PM
.dlls still give same error as before. however, i put all the source code into one project and compiled that. That .dll worked perfectly without a hitch. I have no idea whats screwed up, but it works fine enough for me atm so i'll get back to programming...
Feb 15, 2007 at 6:57 PM
The new Anmation.dll is the same size as when I compile it myself (68kb) whereas the older one was 64kb. The Animation.Content file downloaded is smaller in size (56kb) vs (60kb) when I compile myself. Could the Animation.Content.dll have been compiled using the older Animation.dll?

So I tried the new .dlls and everything still works so far for me regardless of which I use. (even the old ones) Still don't know why the file size discrepency exists.