Having trouble converting code from 3.1 to 4.0

Started by
9 comments, last by Sammie22 13 years, 2 months ago
I am having trouble with the books code. I need to focus on learning concepts, but converting code from XNA 3.1 to XNA 4.0 is proving very troublesome. Does anyone have any advice for dealing with this? Has the code already been upgraded to XNA 4.0 somewhere? Or is there a standard rule sheet of what changed between 3.1 and 4.0?

Thanks,
Jamison
Advertisement
Near the very end of the main workshop thread for this week there's an updated version of the code for XNA 4.
Thanks Crane, I found the week 1 code too. This makes life much easier ;) Jamison
[font=arial, verdana, tahoma, sans-serif][size=2]Hey guys,

When I download the code provided and open them up, I'm getting very odd errors regarding references. I've attached a screenshot.[/font]

Now, I can start new projects in XNA 4.0 and things are fine, but opening up the chapter and lesson source code from this workshop results in this error.

Does anybody have a solution? Much appreciated


[font="arial, verdana, tahoma, sans-serif"]Hey guys,

When I download the code provided and open them up, I'm getting very odd errors regarding references. I've attached a screenshot.[/font]

Now, I can start new projects in XNA 4.0 and things are fine, but opening up the chapter and lesson source code from this workshop results in this error.

Does anybody have a solution? Much appreciated


That is strange(if you can create XNA 4.0 projects just fine).

Have you tried copy-pasting the lesson code into a new project?

EDITED TO ADD: Also, if you're double-clicking on the project files to load them, its definitely not loading up an older/different copy of VS or anything?
Yep I've tried that and it works fine. But it is a little tedious copy/pasting all the files over and what have you.

When I double click, it opens up in Visual Studio 2010. I even right clicked the file and made it the default program to open such files.

Opening Visual Studio 2010 first and then opening the project doesn't change anything either. It really is a weird error and I have no idea what's causing it...!

Could it be my installation of XNA, or VS2010? I'm hoping it isn't, VS takes forever to install D:

[font="arial, verdana, tahoma, sans-serif"]Hey guys,

When I download the code provided and open them up, I'm getting very odd errors regarding references. I've attached a screenshot.[/font]

Now, I can start new projects in XNA 4.0 and things are fine, but opening up the chapter and lesson source code from this workshop results in this error.

Does anybody have a solution? Much appreciated




ok, easy fix :D

1/ in your project there is a brach called "References" Check to see if you have Microsoft.Xna.Framework.<whatever package it is you get an error on>
2/ if you dont right click on References and "Add Reference" goto the .NET Tab and scroll down until you find it. Add the ones needed to the project and it Should be ok :)
Just use 3.1 lol. It's what I'm gonna do. :o
They hated on Jeezus, so you think I give a f***?!

Just use 3.1 lol. It's what I'm gonna do. :o


Even though the work shop is XNA 4.0? odd man, really odd.
"No challenge in life is insurmountable, one can always learn the answer."
FIXED! The problem was my version of XNA 4.0, or so I think. In any case, I uninstalled XNA 4.0 and redownloaded the installer and reinstalled it, and problem solved.

I think the version I had was the Beta, or possibly an earlier version. Or perhaps it just needed a reinstall, I'm not sure...! But I'm glad things work now.

I WAS and still am using 3.1, but I really wanted to get on board with 4.0 for this workshop, and since it allows for development for the windows phone.

EDIT: Alright I think I jumped a little too quickly there. After opening Lesson02 the same problem happened again. I was able to fix it however, by adding in the reference.

I'm still a little confused as to why I had to do that. Under my references, the Microsoft.Xna.Framework WAS in fact there, but it had the little exclamation in the yellow triangle icon, as it could not be located or something like that. After manually adding it in though, everything worked once more.

This topic is closed to new replies.

Advertisement