I have an application X version 1.0 in Visual Basic 2008 and forwarded through setup installed on a user's PC.

In this application was in these settings:


Imports System
Imports MySql.Data.MySqlClient

Now you have a link to webshop and uses HttpWebRequest.
There fore I added the following settings :

Imports System.Net
Imports System.Text
Imports System.IO
Imports System.Web

For this i adding a reference:

Project
-> Adding a Reference, System.Web

So I have the following settings:

Imports System
Imports MySql.Data.MySqlClient
Imports System.Net
Imports System.Text
Imports System.IO
Imports System.Web

Now I have application X version 2.0, Build with Visual Basic 2008

My question is how can I get the application X version 2.0 application on the user PC so that these settings will be available?
This application X version 1.0 is for several months in use!

Sorry, I'm not quite following the problem. My understanding from your description is that you want to install/keep both version of application.

No, i want to overwrite the old version (1.0) with new version (2.0)!

No, i want to overwrite the old version (1.0) with new version (2.0)!

What do you mean overwrite?

replace older version with new version , so all the new featers working such as:

Imports System.Web
HttpWebRequest commands.

replace older version with new version , so all the new featers working such as:

They will work.

If your application version 1.0 is built on (for example) .NET 2.0 and your customer updates the application to version 2.0, which is also built on .NET 2.0, everything works just fine.

However, if your app's version 2.0 uses (for example) .NET 3.5, its up to your app's installer to check that user has .NET 3.5 installed. If it's not, then you have to notify user that .NET 3.5 is required. Depending on how you want to solve that problem, your app's installer can download and install .NET 3.5, or your installer aborts and the user downloads and installs required .NET Framework version by herself.

HTH

Teme64, Thanks for you clear explanation!

My main question is really:.
I have application X version 2.0, Build (X.exe) with Visual Basic 2008 with new features (there for I must add a new Reference, System.Web)!
Can I overwrite the executable of application X (X.exe) version 1.0 with the executable application X (X.exe) version 2.0 on users PC?

I want to know if new Reference I added (SYSTEM.WEB.DLL) is included in the (X.exe)during the BUILD application X

I want to know if new Reference I added (SYSTEM.WEB.DLL) is included in the (X.exe)during the BUILD application X

Assuming you have added reference to System.Web in your project, the reference will be in X.exe. But the System.Web.dll itself is not included in X.exe.

In the project's properties you can select "Target framework" (2.0, 3.0, 3.5, 4.0 in VS2010). I have selected 4.0 and if I now add a reference to System.Web, it will reference to System.Web.dll v4.0.30319. After compiling, I can distribute exe-file and it will run on a PC which has .NET 4.0 installed. However, if the PC has only .NET 2.0 installed, there exists a file System.Web.dll but its version is v2.0.50727 and my exe won't run.

So, if you build X.exe against .NET 3.5, you can copy it over previous version but there has to be .NET 3.5 installed on that PC because your app references assemblies of version 3.5.

HTH

Teme64, Thanks again for you clear explanation!
My "Target framework" is .NET 3.5 , this is also installed on the client PC.

One question , how can check on the client pc of NET 3.5 is installed.
This is for a client pc wich i not self setup.

how can check on the client pc of NET 3.5 is installed.

Information about installed .NET Frameworks can be read from the registry. Application's installer should do that. Here's more information about Windows registry: How to determine which versions and service pack levels of the Microsoft .NET Framework are installed and How to detect the installed version of the .NET Framework in a Visual Studio Setup and Deployment package.

I'm not 100% sure if you could just copy the exe-file and the exe-file would do the check, but I doubt that. However, .NET Framework has exceptions System.PlatformNotSupportedException and System.Deployment.Application.DependentPlatformMissingException but they are related to ClickOnce deployment as far as I know.

HTH

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.