Link to home
Create AccountLog in
Avatar of Navicerts
NavicertsFlag for United States of America

asked on

Visual Studio Refrences 2.0 vs. 1.0 .NET (Upgraded Project)

Hello,

I am programming for the Pocket PC.  I had written a program for an older version of pocket pc and then when we bought new handhelds and a new version of Visual Studio I ran the project through the upgrade wizard.  After the wizard ran I was still able to compile and install the program for the new handheld however I would get an error message that says "invalid database format" when i tried to access the SQL Server CE 3.0 database from the program.  Based off what i read on the web I thought this was because all of the references in the program were .NET 1.0 and i needed .NET 2.0.  I removed all references and added the 2.0 version back in.  Now I am getting a ton of errors like the following...

"Error      1      Unable to load referenced library 'C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Data.dll': Version 2.0 is not a compatible version.      C:\Documents and Settings\johnja\My Documents\XFer folder\Programs\RDA\vbc      RDA"

If I look at my list of references they are all for .NET 2.0 except one, System.Data.Common appears to be .NET 1.0 still, and I don't have any 2.0 version on my PC. The runtime version for System.Data.Common is "v1.1.4322".

I am downloading the .NET 2.0 SDK at the moment to see if i can find the correct version, but it will take a long time to download.

Does anyone know if i am going about this in the correct manner?  On my deployment package there are also "Detected Dependencies" that do not appear in the refrences list for the project, such as "mscorlib.dll".  Both the 1.0 and 2.0 version were showing and i right clicked all of the 1.0 versions and said "Exclude".

I feel like i am digging myself deeper and deeper into a hole here, any help is appreciated.

Thanks

-Navicerts
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
what visual studio version are you using?
Avatar of Navicerts

ASKER

I am running VS 2005.

Bob, I already ran the upgrade wizard and made a few changes I would rather keep the same project but if thats the only way to fix it then so be it. Seems like a mean trick on MS part to put that upgrade wizard there that ruins my project with no warning, did i do something wrong?

If I go with your suggestion after I open the new project I would go to "add new" option and select the forms and code from the backup folder the upgrade wizard created?

Still looking for a better solution.  This is a mess :(
I am never a fan of any free upgrade wizard from Microsoft--period.  There are probably too many artifacts left over to be of any use.  That process that I describes is how you go back a version, but it can be useful to move forward also.

Bob
Do I only add the vb and form files to the new project?
What other kinds of files do you have?

Bob
resx files.
Yes, all you need to do is to add the .vb files, and the .resx files will get added automatically.

Bob
OK, I made a new project and imported all the the vb files.  I can see all of my forms and code and when i go to references now there are a lot more listed (I didn't add any, all automatic).  The "System.Data", "System.Data.SplClient" and "System.Data.SqlCerverCe" all all there and appear to be the correct version.  However, on my Imports section of code they are underlined with a green line and when referenced throughout the code are in error.

If i hover over the ones in error i get the following message...

"Namespace or type specified in the Imports 'System.Data' dosen't contain any public member or cannot be found.  Make sure the namespace or the type is defined and contains at least one public member.  Make sure the imported element name dosen't use any aliases."

Imports System.IO
Imports System.Data
'Imports System.Data.Common
'Imports System.Data.SqlClient
Imports System.Data.SqlServerCe
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Windows.Forms

Open in new window

OK, removed and re-added the references and now it is working, maybe it was the wrong path or something.  Not out of the woods yet but made enough progress for this question to close.

Thank You
That means that you need to add a reference to the System.Data to the project.

Bob
Smart-Device-Application---Solut.png
This new EE format is confusing, I responded to the "Is this what you were looking for?" question but it didn't actually award any points.  Just noticed I had to "Accept" it as well.
One kind of odd final step I had to take for anyone reading this solution.  I had to go into references and highlight the one that was still giving me an error and click "OK", then it worked.  Also, "System.Data.Common" looks like it is bunched in with "System.Data" now, so that one is removed all together.