Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the two ways to deploy and distribute .NET applications

2025-02-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you how to deploy and distribute .NET applications. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

It is now an obvious fact that all applications or products based on .NET technology need .NET runtime support, because .NET is similar in program deployment and distribution, and it requires the support of .NET Framework SDK (JAVA applications need JDK support to run). Unfortunately, the current Win9x series and WinNT/2000 series do not have built-in .NET SDK (it is not difficult to understand Because the launch of .NET technology is later than the release of the various operating systems mentioned above), even the upcoming WindowsXP will not have a built-in .NET SDK.

Although, without the support of. NET SDK, even a simple print "Hello,World!" on the screen Since none of the applications can run, it is impossible for us to require users to install nearly 120m of .NET SDK manually before they can run our own applications! Is there an easier way to publish .NET applications? The answer is yes, and here are two ways to correctly deploy and distribute .NET applications.

1. Deploy and distribute .NET applications with VS.NET

There is no doubt that VS.NET is a very powerful and fast integrated development environment (IDE) for developing .NET applications. Microsoft has always been perfect in matching with its own application technology. Of course, I think only Microsoft can really connect seamlessly with .NET technology.

Let's take a closer look at how to deploy and distribute .NET applications using VS.NET. For the convenience of illustration, let's give an example of a very simple Windows application: simply place a button Button on the screen.

The test environment in which we develop .NET applications is: Windows2000 Server Chinese version (SP2) + VS.NET Beta2 Chinese version.

* step: create a new project based on the original project, and select "install and deploy Project".

In particular, you need to pay attention to the option "add solution", because only in this way will the deployment project and our own applications be placed in the same "solution".

Step 2: after clicking the OK button, the installation wizard will appear.

Because our .NET test program is a Windows application, we selected "create an installer (S) for Windows applications" in the figure above.

Click "next step (N)" and we will see the screen we need to select.

I believe you can understand the meaning of the selected items in the picture intuitively from the Chinese name, so we won't waste any more breath. Click "next" all the way until the completion of the final installation wizard will take 5 steps, which will eventually add an installation project named "Setup1" to the current solution.

Here we slightly mention the concept of "solution" in VS.NET, in fact, the so-called "solution" in VS.NET is similar to the previous concept of "project team" in VB, that is, to integrate multiple projects together, except that the concept of "solution" in VS.NET has a wider coverage, which we can know.

Step 3: after completing the above two steps, we will find that the VS.NET installation wizard has found the various assemblies, system DLL files, resource files and other dependent files used in our application, and we can easily continue to add additional other related files we need, which is similar to InstallShield in this respect, but there is no need to write installation Script scripts.

In this way, we select the VS.NET menu "build (B)"-> "build solution" to generate our installation file Setup1.msi immediately, which you can find in the directory where your application solution is located.

You will be surprised to find this installation file, even if our application is only a simple sentence, it will be 17m big after packaging! However, there is no way. VS.NET will generate a concise. NET SDK in the installation file we just generated.

All that's left is to run our Setup1.msi file directly in Windows9x/NT/2000/XP that doesn't have a .NET environment installed!

two。 Manually deploy and distribute .NET applications

In the above methods, we can feel the convenience and speed of VS.NET to do .NET applications, but not all people use VS.NET integrated development environment to develop .NET applications. For some small applications, it is convenient to develop without installing a huge VS.NET development environment at all. For example, using UtraEdit software to write small and exquisite .NET applications is also a good choice.

Here we will talk about how to manually deploy and distribute our .NET applications without using VS.NET. First of all, there are two categories:

* Class: Web-based .NET applications

For this type of application, it can be said to be the simplest in terms of deployment and distribution. We only need to install the .NET runtime environment on our own server, and the client only needs to be compatible with any browser above IE4.0.

The second category: Windows-based .NET applications.

For this category, applications can be manually packaged using the InstallShield installation software. First of all, find the directory dotNet on our .NET Frameword SDK CD, where we can find an installation file about 15m in size, which is our .net runtime file, similar to JAVA's JRE (JAVA Runtime Environment). This file is also relatively large, but it is much better than the huge 120m of the .NET SDK file.

As for the detailed use of InstallShield, I can't explain it thoroughly here, but it is very convenient to use. I only point out what I need to pay attention to:

(1) in using InstallShield, you can write a little script to monitor that the .NET runtime environment already exists on the target machine, and if so, you don't have to install the .NET runtime files.

(2) all our own DLL files no longer need to be registered, just simply copy them to the directory where our application is located!

The example here is to use InstallShield to make an installer, and of course you can use any other third-party installation authoring software to deploy and distribute our .NET applications, such as Windows Installer, and so on.

Well, finally, when we compare the two ways to deploy and distribute .NET applications, we can see that one of the potential benefits of using the second approach is that we can separate the .NET runtime environment files from our own applications, thus greatly reducing the file size of deploying and installing applications in some cases. The * method is not allowed, it will always package the .NET runtime environment files into the installation file. However, the advantage of * * method is also obvious, that is, it is relatively intelligent, there are few places that require human intervention, and if the .NET application that needs to be deployed and distributed is relatively large software, we recommend using * method!

It is believed that after Microsoft officially releases .NET and VS.NET, it will become easier and faster to deploy and distribute .NET applications, but the way to * is to hope that Microsoft will have a built-in .NET runtime environment in the next version of its operating system, so we don't have to "carry" .NET runtime environment files that are not small all the time. Let's wait and see.

On the deployment and distribution of .NET applications how the two methods are shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report