• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

vb.net program compiled to 3.5-- what's the best way to get it to run in 2.0?

Hi all,

I had to make a very minor edit to the source code of a program written using vs 2003 or 2005, not sure which. The machine on which it must run has .net framework 2.0 and no higher. So, using my vs2008, I tried to compile it to 2.0. I got 102 errors, all caused by system.data.datasetextensions.dll missing. Evidently this dll is only available in 3.5?

The program runs against an important sql server database on the client's server. I don't think that the client will want to upgrade to 3.5 from net 2.0, since they don't want any issues.

I did run the 3.5 executable on the clients machine. It did open the database using an  oledbconnection. However, it errored out later, I think while trying to open an oledbadapter to run a crystal report. The error message was "System.IO.FileNotFoundException: Could not load file or assembly
'System.Data.DataSetExtensions, Version=, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system
cannot find the file specified. "

All the references in my compilable 3.5 project are to 2.0 with the exception of system.data.datasetextensions.dll; that is evidently causing all the problems on the clients machine.  Would it be possible and SAFE to simply copy this 3.5 dll to their machine? Or must I try to get the program to compile on my machine to 2.0 by fiddling around more with the source code?  I would try to compile it on a vs2005 or 2003 machine but not sure I can find one...

  • 5
  • 3
4 Solutions
You can set VS2008 to compile the project using Framework 2.
Did you update the Crystal assemblies to use the VS2008 versions?

OutOnALimbAlwaysAuthor Commented:
Thank you gentlemen-- I will try these two things later today and let you know how it worked.
Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

OutOnALimbAlwaysAuthor Commented:
Sorry for delaying so long. No dice... I wish I knew a little more about .net so that I could assist in assisting me!

I can write a simple program, and because this is really all we need I am seriously considering re-writing the complicated mess that this project appears to my inexperience eyes to be!

It works when I compile it to 3.5. The only 3.5 file it uses is system.data.datasetextensions.dll which apparently is only available in 3.5.

I am getting error messages such as "'Rows' is not a member of Projectname.Datasetname.databasetablename'.  This is coming from the compiler generated code.

Could it have something to do with the datasets causing errors being created from the designer rather than from code? I am compiling this project on my machine, which has vs2008 and references a local database. The project originally (I think) was compiled in 2005 and referenced a server database with a different name. I did go into the designer and changed one of the datasets to reference my database, but I got just as many errors.
OutOnALimbAlwaysAuthor Commented:
update- I deleted the tables from all the "hard coded" datasets and the project compiled without error in net 2.0.  I guess the fault was all in the compiler generated code for these datasets drawn on the forms, and deleting the tables removed all that code.

Evidently when I copied the project over to my machine, it took these datasets and replaced whatever connection info with my connection info, but it messed something up when it came to working in 2.0?

The purpose of the program is only to run crystal reports. I guess the guy was using these datasets as a datasource for the embedded reports he was running-- crazy idea in my opinion -- The datasets translated to tables anyway!!!

So I guess my next step is to replace every reference to the "hard-coded" datasets done in the designer with code that references the correct tables. If there's anything I've learned from what programming I've done, you don't hard-code anything if you can help it.
If the goal is just to run few reports you can use one of the already available report viewers. Here are few free:

(this one is from SAP but cannot refresh reports)

There are some other free viewers too. Always check the license first . It is possible to find "free" viewers which actually will cost you more than some paid - you will find too late that basic features are not available and you will need to purchase a license.

Even using a paid viewer will be more reasonable than to write your own.
Here is a link to  a viewer comparison , which might be useful in case you decide to go in this direction:
OutOnALimbAlwaysAuthor Commented:
Thank you vasto, definitely something to consider especially considering my current expertise in .net languages!

By the way, I had an opportunity to build the project using 2005 rather than 2008 and there were no build errors. The datasets that I referred to came across as blank- no database information.
I don't know what could be the reason. If you are using Visual Studio to generate a stronlgy typed dataset it will save a connection string in the app.config file. Check if it is pointing to the right database. Also be aware that you need encrypt this string otherwise everybody will be able to see the username, password etc ( except you are using integrated security)
OutOnALimbAlwaysAuthor Commented:
Thanks to all for your helpful information.

I was looking at my original question and I wasn't very clear. The project was originally written in Visual studio 2005. It was compiled to net 2.0, all the references were to 2.0 files.

Because the client doesn't want to risk an upgrade to .net 3.5, I wanted to keep it 2.0.

When I tried to compile it to visual studio 2008 express (I should have mentioned express before) it compiled fine, but  only in version 3.5. When I changed it to 2.0, it failed because it needed the 3.5 file 'System.Data.DataSetExtensions.dll". I should probably also have mentioned that it had to convert the project to 2008; 2008 wouldn't open a 2005 project without converting.

Then we bought vs 2005 professional, and it compiled fine in 2.0. It also blanked out all the database information in the compiler generated files. Also, the app.config file was blank.

So I think  maybe vasto hit it right on his last comment. The datasets were NOT pointing to the right database. The app.config file had NO connection information. The only way it worked in net 2.0 without this datasetextensions dll was to blank everything out. I blanked it out by deleting the datasets and vs 2005 blanked it out by deleting the dataset information.

What was so confusing was it appeared the lack of datasetextensions.dll in 2.0 was causing all the problems.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now