There are many files and folders in ASP. net2.0.
1. app_global.asax.compiled
2. app_code.compiled
3. precompiledapp. config
The following describes how to use Microsoft Web deployment projects to generate a unique assembly in Visual Studio 2005.
Download Microsoft Web deployment projects:
Http://msdn2.microsoft.com/en-us/asp.net/aa336619.aspx
Declare that my vs2005 version is team suit.
After installation, You can see "add web deployment project…" in the context menu of "generate" and web projects ...", Now, in the solution, right-click your website project name, right-click it, and add a web deployment project name, which is the Assembly name generated after future compilation, the default name is "Current Project name_deploy" (my project is web_deploy). In this way, a project web_deploy will be added to the project solution, then we can operate web_deploy to achieve our goal.
Right-click the properties page of The web_deploy project and check "configuration properties". Check "Compilation" options first:
Output Folder in compilation sets the project output path, which can be the default value.
Check Generate debug information and allow this precompiled site to be updatable.
Four options in output assemblies:
1. merge all outputs to a single assembly-all outputs are compiled into an assembly (parameter: Assembly name) 1.1 treat as library component (remove the app_code.compiled file) -app_code is treated as a class library (deleting the app_code.compiled file)
2. merge each individual folder output to its own Assembly-a separate directory in the web project will be compiled into a set of Programs (parameter: Assembly prefix)
3. merge all pages and control outputs to a single assembly-All page controls are compiled into one assembly (parameter: Assembly name)
4. create a separate Assembly for each page and control output-create an assembly signing for each page and control using the key file to create a strong namespace Assembly Here we only need to set "1. merge all outputs to a single assembly-all outputs are compiled into an assembly (parameter: Assembly name) "(I set web_deploy) and "1.1 treat as library component (remove the app_code.compiled file)-app_code is considered as a class library (delete the app_code.compiled file)" (This check box is required ).
In this way, we can change the page inheritance relationship of the program to publish the website! For example:
Modify the page of each aspx file on the website as follows:
Index. aspx
<% @ Page Language = "C #" masterpagefile = "~ /Masterpage. Master "autoeventwireup =" true"
Codefile = "index. aspx. cs" inherits = "WJJ. Web. Index" Title = "Homepage" %>
Note that inherits = "WJJ. Web. Index" and WJJ. Web are my own namespace.
Index. aspx. CS should also be added with a namespace
Namespace WJJ. Web
{
Public partial class index: system. Web. UI. Page
{
Protected void page_load (Object sender, eventargs E)
{
}
}
}
Now, right-click the project web_deploy and click "re-create". The problem is finally solved!
The page generated by index. aspx is as follows:
<% @ Page Language = "C #" masterpagefile = "~ /Masterpagedefault. Master "autoeventwireup =" true"
Inherits = "WJJ. Web. index, web_deploy" Title = "Homepage" %>