To create an assembly-information file for your website
- Using a text editor, create a new assembly-information file. For Visual Basic applications, the suggested file name is AssemblyInfo.vb. For C# applications, the suggested file name is AssemblyInfo.cs.
[assembly:System.Reflection.AssemblyVersionAttribute("versionNumber")]
| |
| Do not place the assembly-information file in the App_Code directory. If you place the assembly-information file in the App_Code directory, it will be compiled automatically by the ASP.NET runtime and might cause compilation errors later in the compilation process. |
To specify the assembly-information file in your .aspx page
- Open your .aspx file in a text editor.
- Add the following attribute to the @ Page directive in the .aspx page.
CompilerOptions="path\AssemblyInfo.cs"
Replace the path parameter with the physical path to the assembly-information file on disk.
If the path to your assembly-information file contains spaces, you must enclose the path and file name in single quotation marks (').
CompilerOptions='"path with spaces\AssemblyInfo.cs"'
Replace the path with spaces parameter with the physical path to the assembly-information file on disk.
- Publish the website.
To specify the assembly-information file in your Web.config file
- Open your Web.config file in a text editor.
- Add the following code to your Web.config file.
type="Microsoft.CSharp.CSharpCodeProvider, System,
Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" warningLevel="1"
compilerOptions="path\AssemblyInfo.cs" />
- Publish the website
0 comments:
Post a Comment