Installation Configuration ASP.NET

xiaoxiao2021-03-06  83

Installation Configuration ASP.NET

Preface:

There is not much to say about the .NET platform provided by Microsoft, here we are just from .NET in web technology, it is discussed .asp.net is the best application tool on .NET in Web technology .asp.net is relative Previous Microsoft ASP's web application development tool. In the ASP era, the execution code is embedded in the ASP page, so it should be said to develop the ASP that is in making a web, but ASP.NET is a web application.

Let's follow my steps, let's take a look at how to get started with ASP.NET

1.1 Step 1: Install IIS Server

IIS is an Internet information server on Windows. Simply, the server software for establishing WWW sites. Apache under Linux is similar. Because the general user's computer is not installed, IIS is also our development ASP.NET necessary Software, although it is not a development tool, but it is also we must.

IIS installation files are usually placed on Windows installation CD, so you have to have your Windows installation disc, then choose to add IIS this Windows component from above.

After the installation is complete, the C: / INETPUB / WWWROOT directory is the directory corresponding to your WWW server. For example, http: // localhost / xxx corresponds to the C: / INETPUB / WWWROOT / XXX this directory. The localhost is the local host. It means. Of course, if you have to access this machine, then you need to change localhost to the IP address of this machine.

1.2 Step 2: Install development tools

ASP.NET development tools is of course Microsoft's Visual Studio.net.

My own machine is 2003 version. Generally vs.net will bring Visual C , Visual C #, Visual Basic.NET, etc..aSP.Net is of course the tool we want to explain based on .NET development web applications. The code of the web application developed by .asp.net can be C # or VB.NET, in short, the execution code for the web page developed by ASP.NET is based on .NET.

Sometimes, our installation IIS and VS.NET is reversed, first .NET rear IIS, resulting in some things (such as ASP.NET) on our IIS, such as ASP.NET), then Solution It is very simple. You can run an IIS registration program in the .NET installation path. In my computer, the path is as follows: c: /windows/microsoft.net/framework/v1.1.4322, we just do this in the command prompt Program, ie:

C: /Windows / Microsoft.Net/framework/v1.1.4322> c: /windows/microsoft.net/framework/v1.1.4322/ASPNET_REGIIS.EXE -I

or

C: /Windows / Microsoft.Net/framework/v1.1.4322> c: /windows/microsoft.net/framework/v1.1.4322/ASPNET_REGIS.EXE / I

After the execution:

Start installing ASP.NET (1.1.4322.0).

ASP.NET has been installed (1.1.4322.0).

1.3 Step 3: Create a web application using Visual Studio.net

First open vs.net, then select Create New Project

After selecting an ASP.NET web application.

Then just add something to the webpage:

Then click to run the web application, it will appear:

This web application we have developed: Webform1.aspx

General ASP.NET's web page extension is ASPX

1.4 Fourth step to release my ASP.NET web application to other servers

I am planning to explain the most detailed explanation. Because IIS is involved in the implementation settings of the ASP.NET, the web program is uploaded, the implementation and other details, but these problems are very good in the general book. Less, but it is what we have encountered often in practical application, so it is necessary to explain it here.

Generally we use VS.NET to create a web project, VS.NET will automatically put some settings about IIS, web pages, etc., so we don't need you to change. But if you want to develop Web programs Put in someone else's machine, such as the public network server, you need to set these things manually. First we need to know is that any ASP.NET to perform ASP.net is required in the IIS on IIS. Web The virtual directory of the program. For example, I want to create a virtual executable directory for D: / WebGame1 as a directory.

Create / set virtual directory

Open the Internet Services Manager in Administrative Tools in the Control Panel

Find the "Default Web Site" in the directory on the left, then click New Virtual Directory in the Right-click menu to enter the Wizard dialog that creates a virtual directory.

In the creation wizard,

1 Step. Take a name on the Virtual Directory Alias ​​dialog, I take it or WebGame1,

2 Step. Enter the path of "D: / WebGame1" on the "Directory Path".

3 Step. Point directly in the dialog of the visual limit

4.Step. Finally Create a virtual directory

Of course, in fact, you can also do not have to create a virtual directory, in fact, you copy the webgame1 this directory to C: / INETPUB / WWWROOT / Under IIS, right-click on its "Properties", pop-up attribute dialog

Then select the "Create (E)" button in Application Settings. Then this directory is set to a virtual directory.

Test ASP.NET

When the virtual access directory is successful, then you can put a normal * .html web file to this directory. Then change to * .aspx, test it with http://localhost/xxx/xxx.aspx. If you can open, congratulations, your ASP.NET has been successful.

About the web application.

The WEB program created by typical vs.Net is the way in the post-code, that is, * .aspx and * .aspx.cs are separated. In the * .aspx file, indicate where the code file is located and inherited, the Class of inheritance is as follows

<% @ Page language = "c #" codebehind = "Webform1.aspx.cs" inherits = "WebGame1.webform1"%>

The code here is where our * .aspx.cs code file is located. Inherits is the Class name of our web form.

Generally, we must best compile the CS code. After the DLL is changed to the server's virtual directory. So just remove the codebehind this. But inherits must indicate the Class of the web form.

Note 1: After VS.NET compiles the code, you will generate a bin directory on the engineering directory. You will save a file called WebGame1.dll. When you upload the server, you need this bin directory (including the DLL inside. File) Under the root of the virtual directory, such as the D: / WebGame1 virtual directory you created in front, it is d: / webgame1 / bin. Your * .aspx directory inherits = "WebGame1.webform1" is Specifies this * .aspx's web form code is WebM1 this web class in the webgame1.dll file inside the virtual directory / bin.

Note 2: If there is no special needs, in addition to the * .aspx and bin directory, we'd better not upload the files in other vs.net projects into the virtual directory of the server, otherwise the prompts that often have access to errors. (In short, I was a long time being this problem, I don't know what is going on).

Create a Web program installation deployment program

1. Open your .NET, right click on your project (Solution), select Add New Project (add a new project).

2. Select the Web Setup Project (Web Installation item) of Setup and Deployment Projects. (Note SetupProject's storage path. Usually default)

3. VS window displays the file system (you setup name). Use the mouse to click the "Web Application Folder" of the "Web Application Folder" in the left column, right-click "Web Application Folder", select Add Item Output, and select Primary Output and Content Files.

4. Your project will add a new YouSetupname project, which is the installed project. Save it, sometimes it will be wrong.

5. Because .xml ,.rpt, .gif file cannot be automatically added to the project, so you have to add it. In the Solution Explorer, right click on YOUSETUP Project (your installation item name), select "Add File", then add your .rpt, .xml, .gif file;

6. If you use Crystal Report, you will add Crystal Reprot's support file. In the Solution Explorer, right-click YouSetup Project (your installation item name), select Add Merger Module, found in the window, and select C: / Program Files / Common Files / Merge Modules / DotNetCrystalReports.msm, Open, joined;

7. Right-click on the "File System on Target", select the properties, in the Properties window, set the productName to "I have the item name you want to package"

8. Right-click on "Web Application Folder", select the properties, in the Properties window, set the defaultDocument to "your default login page", "start page",

9. Check your YouSetupname project, press right-click, select "Generate"; or "Generate YourSetupFileName" in the "Generation" of the main menu;

10. Then, in the storage path of the C: / Documents and Settings / Administrator / My Documents / Visual Studio Projects / Kaoqin / file, there is a folder of YouSetupname, and there is a debug folder below, you want Debug All of the following files below.

11. Take the file under Debug Folder on the machine you want to install, and then install it. If there is a database, you can restore the library, you can use it.

转载请注明原文地址:https://www.9cbs.com/read-105037.html

New Post(0)