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=3.5.0.0, 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...

Thanks.
OutOnALimbAlwaysAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vastoCommented:
You can set VS2008 to compile the project using Framework 2.
http://www.codeproject.com/Articles/20531/Targeting-the-NET-Framework-2-0-with-Visual-Studio
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
Did you update the Crystal assemblies to use the VS2008 versions?

mlmcc
0
OutOnALimbAlwaysAuthor Commented:
Thank you gentlemen-- I will try these two things later today and let you know how it worked.
0
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

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.
0
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.
0
vastoCommented:
If the goal is just to run few reports you can use one of the already available report viewers. Here are few free:

http://www.businessobjects.com/forms/crystalreports/viewer/
(this one is from SAP but cannot refresh reports)
http://www.r-tag.com/Pages/FreeCrystalReportsViewer.aspx
http://www.freecrystalreportsviewer.com/

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:
http://kenhamady.com/viewerfeaturematrix.pdf
0
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.
0
vastoCommented:
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)
0
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.