Undocumented .Net The Out Campaign: Scarlet Letter of Atheism

Sunday, December 2, 2007

Web Application Project 2008 still not working with new Web Deployment Project 2008 december CTP

If you have seen me around the asp.net forums, blogs(scottgu mainly and some others), msdn forum and msdn blogs you will remember my first blog post about the web application project not working with the web deployment project. Basically you can not get the 4 build output types, that comes with the web deployment project, to work with a web application project.

The reason being that you need to change the pages and controls attribute CodeBehind to CodeFile, the CodeBehind Attribute is there only for backwards compatibility with previous version of the asp.net framework (mainly 1.1). The second reason is to enable the edit and continue functionality in the web application project microsoft had to make the code behind file (mypage.cs and mypage.design.cs) build action to compile, other wise the csc.exe compiler will not build them into the main output dll and you will not be able to use edit and continue. So if you change the codebehind attribute to codefile and turn the build action of ALL code behind files to none the web deployment project start working because the csc.exe no longer gets ride of the file that aspnetcompiler.exe and aspnet_merge.exe need to do their magic.

The official answer i got from a representative of microsoft was that i was running a old build of the web application project and web deployment project so i was not getting the desired output because of that. NO WAY!

I had my hopes high, that they would fix this problem so i would not be required to build Items templates to replace the visual studio ones and build a wrapper for the item template wizard extension so i could the file build event in visual studio and change the build action of my code behind files to none when ever i create new files.

The time i release my findings microsoft was just about to release visual studio 2008, when they did they kept back the web deployment project, I thought wow is it possible that my blog post was seen by people in microsoft that they decided to keep the web deployment release back so they could look into this? I did notice using google analicts that i have 4 visits from people in microsoft (one in washington, one in seattle, one in california and one in london).

Well now the web deployment project is available again and unfortunatly i still have to change my templates, and use the wizard extension wrapper, becuase the web deployment project still not working out of the box with the web application project.

i can demonstrate that see the build outputs below, the first four are from a standard web application project using the the new web deployment project december ctp. I have also attached to this post the code that i used to run this examples.

first web application and web deployment project test using out of the box features.
2 project:

WebApplicationTest.csproj_deploy (web deployment project)
WebApplicationTest (web application project)

The only thing i have done to this projects is that i have added a blank webform so the multiple output build types can be seen to work.

Remember the web pages have the code behind attribute and the build action of the code behind files is compile (as default).

Build Runs --------------------------------

1 - First build using default web deployment settings

1 ------ Build started: Project: WebApplicationTest, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\WebApplicationTest.dll /target:library Default.aspx.cs Default.aspx.designer.cs Properties\AssemblyInfo.cs WebForm1.aspx.cs WebForm1.aspx.designer.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 WebApplicationTest -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest\bin\WebApplicationTest.dll
6 ------ Build started: Project: WebApplicationTest.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /WebApplicationTest.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest" -u -f -d .\TempBuildDir\
8 Running aspnet_merge.exe.
9 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aspnet_merge.exe .\TempBuildDir -o WebApplicationTest.csproj_deploy -a -debug -copyattrs
10 aspnet_merge : warning 1013: Cannot find any assemblies that can be merged in the application bin folder.
11 Successfully merged '.\TempBuildDir'.
12 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
13 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
14 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
15 Done building project "WebApplicationTest.csproj_deploy.wdproj".
16 ========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ==========

This build failed to merge all output into a single assembly.
Notice the warning on line 10.

2 - Second build using merge assemblies into folder assemblies

1 ------ Rebuild All started: Project: WebApplicationTest, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\WebApplicationTest.dll /target:library Default.aspx.cs Default.aspx.designer.cs Properties\AssemblyInfo.cs WebForm1.aspx.cs WebForm1.aspx.designer.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 WebApplicationTest -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest\bin\WebApplicationTest.dll
6 ------ Rebuild All started: Project: WebApplicationTest.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /WebApplicationTest.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest" -u -f -c -d .\TempBuildDir\
8 Running aspnet_merge.exe.
9 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aspnet_merge.exe .\TempBuildDir -prefix undocnet_ -a -debug -copyattrs
10 aspnet_merge : warning 1013: Cannot find any assemblies that can be merged in the application bin folder.
11 Successfully merged '.\TempBuildDir'.
12 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
13 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
14 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
15 Done building project "WebApplicationTest.csproj_deploy.wdproj".
16 ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

This build failed to merge all output into a single folder assemblies.
Again Notice the warning on line 10.

3 - Third build using merger all pages and control into one assembly

1 ------ Rebuild All started: Project: WebApplicationTest, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\WebApplicationTest.dll /target:library Default.aspx.cs Default.aspx.designer.cs Properties\AssemblyInfo.cs WebForm1.aspx.cs WebForm1.aspx.designer.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 WebApplicationTest -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest\bin\WebApplicationTest.dll
6 ------ Rebuild All started: Project: WebApplicationTest.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /WebApplicationTest.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest" -u -f -c -d .\TempBuildDir\
8 Running aspnet_merge.exe.
9 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aspnet_merge.exe .\TempBuildDir -w undocnet -a -debug -copyattrs
10 aspnet_merge : warning 1013: Cannot find any assemblies that can be merged in the application bin folder.
11 Successfully merged '.\TempBuildDir'.
12 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
13 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
14 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
15 Done building project "WebApplicationTest.csproj_deploy.wdproj".
16 ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

This build failed to merge all output into a single assembly.
Again Notice the warning on line 10.

4 - Forth build using single page assemblies

1 ------ Rebuild All started: Project: WebApplicationTest, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\WebApplicationTest.dll /target:library Default.aspx.cs Default.aspx.designer.cs Properties\AssemblyInfo.cs WebForm1.aspx.cs WebForm1.aspx.designer.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 WebApplicationTest -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest\bin\WebApplicationTest.dll
6 ------ Rebuild All started: Project: WebApplicationTest.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /WebApplicationTest.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest" -u -f -c -d -fixednames .\TempBuildDir\
8 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
9 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\WebApplicationTest.csproj_deploy\Debug\"
10 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
11 ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

This build failed to merge all output into a single page and control assemblies.
Again Notice there is no warning as the asp merger is not required to do this build.

Now you see that the new web deployment project is not working with the web application project.

Lets create 2 new projects one a web application and one web deployment project out of it.

follow this steps below:

1 add a new web form with default name
2 change the codebehind attribute in the default.aspx and webform1.aspx to codefile
3 change the build action for each of the code behind files to none ( remember the desing.cs file too).

and basically run the same test above. see the result of mine below:

1- First build of Undocnet web app

default settings

1 ------ Build started: Project: UndocNetWebApplication, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\UndocNetWebApplication.dll /target:library Properties\AssemblyInfo.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 UndocNetWebApplication -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication\bin\UndocNetWebApplication.dll
6 ------ Build started: Project: UndocNetWebApplication.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /UndocNetWebApplication.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication" -u -f -d .\TempBuildDir\
8 Running aspnet_merge.exe.
9 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aspnet_merge.exe .\TempBuildDir -o UndocNetWebApplication.csproj_deploy -a -debug -copyattrs
10 Successfully merged '.\TempBuildDir'.
11 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
12 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
13 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
14 ========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ==========

Have a look at the debug folder inside of the web deployment project folder and you will see that the bin folder contains the correct dll name and that it merged all the output into a single dll.
Notice that we still have the default dll created by the csc.exe, basically that contains the assembly info .cs file that we still compiling into a dll.
Notice the aspnet_merge.exe has no warnings or errors this time. line 9 and 10.

2 - Second build using the second output

Building each individual folder into their own assembly. i chose the undconet_ prefix.

1 ------ Rebuild All started: Project: UndocNetWebApplication, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\UndocNetWebApplication.dll /target:library Properties\AssemblyInfo.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 UndocNetWebApplication -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication\bin\UndocNetWebApplication.dll
6 ------ Rebuild All started: Project: UndocNetWebApplication.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /UndocNetWebApplication.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication" -u -f -c -d .\TempBuildDir\
8 Running aspnet_merge.exe.
9 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aspnet_merge.exe .\TempBuildDir -prefix UndocNet_ -a -debug -copyattrs
10 Successfully merged '.\TempBuildDir'.
11 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
12 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
13 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
14 ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Notice the we do not have the error or warning in the aspnet_merge.exe and that we have got our undocnet_.dll file in the bin folder of the web deployment project output.

3 - Third build type

Merge all output pages and controls into a single assembly ( i decided to call this one UndocNetAllPAgesAndCOntrol)

1 ------ Rebuild All started: Project: UndocNetWebApplication, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\UndocNetWebApplication.dll /target:library Properties\AssemblyInfo.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 UndocNetWebApplication -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication\bin\UndocNetWebApplication.dll
6 ------ Rebuild All started: Project: UndocNetWebApplication.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /UndocNetWebApplication.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication" -u -f -c -d .\TempBuildDir\
8 Running aspnet_merge.exe.
9 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aspnet_merge.exe .\TempBuildDir -w UndocNetAllPAgesAndCOntrol -a -debug -copyattrs
10 Successfully merged '.\TempBuildDir'.
11 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
12 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
13 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
14 ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Notice that we done have any errors or warning in aspnet_merge.exe.
Notice that we have our UndocNetAllPAgesAndCOntrol.dll file in the output folder of the web deployment project.

4 - single page assemblies

this should create one dll per page and control on our web application.

1 ------ Rebuild All started: Project: UndocNetWebApplication, Configuration: Debug Any CPU ------
2 C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\UndocNetWebApplication.dll /target:library Properties\AssemblyInfo.cs
3
4 Compile complete -- 0 errors, 0 warnings
5 UndocNetWebApplication -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication\bin\UndocNetWebApplication.dll
6 ------ Rebuild All started: Project: UndocNetWebApplication.csproj_deploy, Configuration: Debug Any CPU ------
7 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /UndocNetWebApplication.csproj -p "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication" -u -f -c -d -fixednames .\TempBuildDir\
8 if exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" rd /s /q "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
9 if not exist "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\" md "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WebAppAndDeploymentTest\UndocNetWebApplication.csproj_deploy\Debug\"
10 if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
11 ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Notice that we dont have any errors or warnings in the aspnet_merge.exe.
And if you look at the buid output folder in the web deployment project you will see the dlls for each of the page/controls on our web application project.


things you need to watch for:

1 You need to do is the remove the csc.exe dll output file (usually the projectname.dll) from the build folder otherwise you will get errors in IIS.
2 dont put any individual code (classes) in the web application project other wise the csc.exe wil compile into the default dll, and you wont be able to use them. (use a seperate project for them).

======================

there are other things i have noticed in visual studio 2008:

Web site projects have their templates for controls and pages using the codefile attribute.
as everyone knows that web site project does not have it own project file (instead it uses the solution file for keeping track of it items*) the cs files dont have a build action so the web deployment project works out of the box with it. you will see on my examples that you can download below that the website2 project i have there works just fine with the web deployment project.

* which is a nightmare if you share the solution file with resources across the globe with on a visual source safe exclusive check out policy

I thinking about building Alternative* Web Application project that allows full control on the output of you web site, instead of forcing one specific way you will be able to chose how you do it. when the MVC framework comes out i will make it compatible with it.

*(a bit of Alt.Net feeling for you)

well my apologies if this felt like reading a wall of text.

I hope if you are having any problems with web application project build error (multiple identical types) or not being able to build your web application project using the web deployment nice features, that this post and my previous post have helped you.

Lets see what the IIS7 deployment features and visual studio 2008 asp.net extension will bring for us.

regards

Daniel Portella
Undocmented .Net Blogger

If you want to download the solution above you can do it here


0 comments:

Post a Comment

Daniel Portella - http://undocnet.blogspot.com - http://twitter.co/dmportella - This posting is provided "AS IS" with no warranties, and confers no rights.