Skip to main content
GameDev.net gamedev.net
🔒 Locked

Having trouble converting code from 3.1 to 4.0

Started by Jamison73 Feb 3, 2011 at 2:55 PM 9 replies 4.3k views
Original Post
Jamison73
Jamison73
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
Jamison73
Jamison73
Thanks Crane, I found the week 1 code too. This makes life much easier Jamison
dechorus
dechorus
[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

ChaosFollowing
ChaosFollowing

[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?
dechorus
dechorus
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:
Andy474
Andy474

[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

1/ in your project there is a brach called "References" Check to see if you have Microsoft.Xna.Framework.
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
Fl4sh
Fl4sh
Just use 3.1 lol. It's what I'm gonna do.
They hated on Jeezus, so you think I give a f***?!
Psyentist
Psyentist

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


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."
dechorus
dechorus
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.
Sammie22
Sammie22

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.


I've had that happen too. It could be a path issue. Anyway, it's not just you, and it's something to check when you load up projects.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.