Question VB.Net 2008 Won't run without .Net 3.5?

bryan641

New member
Joined
Aug 22, 2008
Messages
3
Programming Experience
10+
I'm not an expert VB programmer, but I needed to be able to read the status of a device through COM1 (RS232) on the server computer for a web application. I cobbled together a simple program to read from a serial port and write out a status file. I used an RS232 vb.net class I found on the 'net and it works great. I monitor the serial port in a separate thread, and when it reads data, it calls a separate subroutine to read, and then re-write the status file using the StreamReader and StreamWriter classes.

The problem I'm running into is that if .NET Framework 3.5 isn't loaded, everything looks like it's running, but the text file never gets updated. I can see the last read status is updated on my status line, so the thread and the RS232 interface are running properly. The stream classes (as well as the Threads) all say they are supported in .Net 1.0, and I'm not getting any error messages or anything -- any exceptions are updated in the status bar too.

Of course, I discovered the failure when I flew to corporate HQ to demo the application and it wouldn't run properly on the computers there. I was still able to demo it by running it on my laptop. .NET 1.0 was already installed. I loaded .NET 2.0, then .NET 3.0 and it still wouldn't work. When I install .NET 3.5 it works fine.

Any ideas what could be wrong? Ever hear of anything like this?

--Bryan
 
If you're using features that are in the 3.5 Framework then you need to have it installed for the program to work (which means your program should be set to target the 3.5 framework).

If you're wanting/needing to target just the 2.0 or 3.0 Frameworks then change the target framework setting in the project (It's in the project properties) then recompile the app, keep in mind that by changing the target framework you will not be about to use anything in a higher version of the framework without changing the target again.
 
Thanks for the quick reply.

I've tried changing the target to .NET 2.0, but there were references to 3.5 I'm trying to remove. One of them is System.Xml.Linq. I have no idea what part of my project thinks it requires this. I've not done anything in the project with XML, so it seems it must be something Visual Studio added for me. I've removed it from the list of references in my project, and now I get a warning when I build the project:
Namespace or type specified in the project level Imports "System.Xml.Linq" doesn't contain any public member or cannot be found. ....

--Bryan
 
In the project properties window there's a References tab on the left in there you can remove the System.Xml.Linq namespace (and any others that are causing you problems)
 
Solved - Thanks!

Thanks so much for your help! I hadn't noticed the "Imported namespaces" below the project references list. I had removed it from the references list, but it was still checked as imported further down.

--Bryan
 
Back
Top