Hi ravikiran189,
From your description, I understand that you have added the web deployment project in the web site solution. You can generate the versioned assembly when selecting the “Merge each individual folder output to its own assembly” option in web deployment project’s property page. However, by selecting the “Create a separate assembly for each page and control output” option, all the version of generated assembly is 0.0.0.0. If there has been any misunderstanding, please let me know.
As you can see, when we select the “Create a separate assembly for each page and control output” option, the merge options that we can assign assembly version is grayed out. It is because when selecting this option, Visual Studio IDE will not invoke the aspnet_merge.exe tool to merge each output assemblies. It just invoke the aspnet_compiler.exe tool to precompiler the web site project that by default set assembly versio to 0.0.0.0.
To solve this issue, we need to add the AssebmlyInfo.cs file (AssebmlyInfo.vb for VB project) in the web site project, and the set the AssebmlyInfo file setting in web.config of the web site project (in the compilerOptions attribute of the compiler element). For your reference, please refer to the following steps:
1. Add an AssemblyInfo.cs file in the web site project, the content of the AssemblyInfo.cs is like the following:
*************** AssemblyInfo.cs ********************
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
[assembly: AssemblyVersion("1.2.3.4")]
[assembly: AssemblyFileVersion("1.2.3.4")]
2. Specify the assembly-information file in the compilerOptions attribute of the compiler element.
****************** web.config *********************
</configuration>
……………
<system.codedom>
<compilers>
<!-- zero or more compiler elements -->
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider, System,
Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
compilerOptions="E:\program2008\WebSite\GeneralWebSite\AssemblyInfo.cs"
warningLevel="1" />
</compilers>
</system.codedom>
</configuration>
3. Rebuild the web deployment project and check its output in the "bin" folder.
For official introduction, please refer to the link below.
How to: Create Versioned Assemblies for Precompiled Web Sites
http://msdn.microsoft.com/en-us/library/ms228042(VS.85).aspx