Does the Web Application Project supports compiling pages on its own dll?
I tried using the Web Deployment Project with a WebSite Project and it seems it can compile the pages into their own dll. But with the Web Application Project, the option "Create a separate assembly for each page and control output" doesn't work. It this how
it is supposed to work? By the way, the output of the Web Deployment Project is only the Primary Output of the Web Application Project excluding the Content Files. I thought the output of the Web Deployment Project is the deployable part?
Please point me to the right direction or to where I can get some information about this.
Excellent question. Web Deployment Projects leverage two utilities aspnet_compiler.exe and aspnet_merge.exe.
aspnet_compiler.exe ships with the 2.0 Fx and pre-compiles an entire web site using the same compilation system as ASP.NET. Instead of just caching the pre-compiled bits into the ASP.NET temporary files folder it puts the files into re-deployable folder.
aspnet_merge.exe is a utility that ships with Web Deployment Projects. Because the aspnet_compiler.exe produces numerous assemblies, this utility offers various options to merge the aspnet_compiler generated assemblies into a smaller set of assemblies or
even a single assembly.
So how does this relate to Web Application Projects?
Web Application Projects allows you to pre-compile the code behind and other classes with Visual Studio 2005 into a single assembly and supply this assembly as an input in the ASP.NET compilation process by putting it in the ~/bin folder.
When using WAP there are two stages to the compilation process.(This is the same as VS03).The first stage is to use VS to compile all the code behind and other classes into a single assembly and deploy it to the ~/bin folder.
All the code in the .aspx, .ascx, .master, etc.. is always generated and compiled by ASP.NET, either dynamically during an http request or when using the aspnet_compiler.exe.
When ASP.NET is generating the code for each page, it’s looking at the “<%@ Page” directive and either seeing CodeFile="file" or CodeBehind="file".
This is a key distinction.If it’s a CodeFile attribute ASP.NET knows it’s responsible for the compilation of the code behind code.
This is what is used for Web Site projects included in VS05.
If it’s a CodeBehind attribute ASP.NET knows the code behind has already been compiled and all it has to do is derive the page class from an already compiled code behind assembly.This is what is used in Web Application Projects and VS03.
Finally, I’m going to attempt to answer your question about Web Deployment Projects and assemblies per page.The ability to produce an assembly per page is a feature of the ASP.NET compilation system.When it is compiling pages it has the ability to batch pages together when generating an assembly or to generate an assembly per page.That is provided ASP.NET is doing the compilation.
In the case of Web Application Projects the code behind for the pages have already been compiled into a single assembly.
All ASP.NET has left to do is to generate the code for each page/control and generate the assemblies for those.
If you’ve decided to make the deployable site updateable then the aspnet_compiler won’t even do that so the pages/controls can be edited and dynamically recompiled on the site.
If it’s not updateable you can still get an assembly per page containing just the page class generated by ASP.NET and not the code behind since it’s already been compiled by VS.
I apologize for such as long winded reply but understanding what is being compiled when really helps understand the deployment options.
Brad, thanks for the explanation on the difference between these two projects. But I still don't get exactly if it is possible to generate separate assemblies per page on a Web Application Project. As far as your statement is concern, it's possible, but how
I may going about it? I was hoping there is that same option as with the Web Deployment Project on a WebSite Project...
By the way, I was hoping that instead sending the whole website for an update, I only need to send the pages/dlls that are only updated cutting unnecessary downloading/uploading files. Or do you have any suggestion implementing this `plug n play` sort of deployment?
Or is this possible with ASP.NET without a downtime or a server restart?
Same here... as a side-effect of using a single assembly in the build, you can't use multiple languages (i.e. C# & VB.Net) to put pages together in a WebApplicaiton as you could in a WebSite application. Can we have the cake and eat it too by using the old
format yet enable single page assembly generation?
Web Application Projects always compile the entire project into a single assembly. The only way to truly get an assembly per page (complete with it's code behind file) is to use a Web Site project and a Web Deployment project.
I suspose that if you use inline code for all your pages and not code behind the yes you could generate a seperate assembly for every page in a WAP project but that kind of defeats the purpose.
As far as multiple languages, That's a cool feature of Web Sites and dynamic compilation. I know that some developers are factoring their sites up into several WAP projects all building into the same bin. Each project is a seperate assembly. While not
an assembly per page is does give you the ablity to factor you site into seperate serviceable units. The other nice thing is that each project could be in a different language from the others. While not mixing languages within a project you are using multiple
projects within a Site.
How does the build process get affected when using a Web Deployment Project with the Web Application Project in a team build environment?
I am choosing the option of merging all the dlls into one in the web deployment project (which I believe is supported for the WAP?) but I am having a weird error related to type loading when trying to run a standard team build for the WDP project. In visual
studio, the solution builds fine and the WDP does seem to play well with the WAP. Based on the errors, it seems that the WDP AspNetCompiler target is having problems loading user controls used on my pages. User controls are defined in a separate folder and
namespace in the WAP.
Here is a sample ascx heading of one of my controls:
<%
@ Control
Language="C#"
AutoEventWireup="true"
Inherits="Corp.Security.Web.Controls.ApplicationsCombo"
Codebehind="ApplicationsCombo.ascx.cs" %>
And a sample registration from one of the pages that use the control:
The errors from the team build are below. I would really appreciate any help on this.
Thanks
Mario
The errors I get when doing a team build are:
Target AspNetCompiler:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /Corp.Security.Web.csproj -p c:\TFSBuilds\Corp.SecIt\Corp.Security.WeeklyDevTestBuild\Sources\Applications\Corp.Security\Corp.Security.Web -u -f c:\TFSBuilds\Corp.SecIt\Corp.Security.WeeklyDevTestBuild\Binaries\Release\_PublishedWebsites\Corp.Security.Web.Deploy\
/Corp.Security.Web.csproj/SecurityLogin.aspx(1): error ASPPARSE: Could not load type 'SecurityLogin'.
/Corp.Security.Web.csproj/Controls/CompaniesCombo.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.CompaniesCombo'.
/Corp.Security.Web.csproj/Controls/ApplicationsCombo.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.ApplicationsCombo'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/SecurityLogin.aspx(46): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/EditApplication.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.EditApplication'.
/Corp.Security.Web.csproj/Applications/EditApplication.aspx(3): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/CreateApplication.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.CreateApplication'.
/Corp.Security.Web.csproj/Applications/CreateApplication.aspx(3): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/AddUsersToApplication.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.AddUsersToApplication'.
/Corp.Security.Web.csproj/Applications/AddUsersToApplication.aspx(5): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/Applications.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.Applications'.
/Corp.Security.Web.csproj/Applications/Applications.aspx(2): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/ApplicationsCombo.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.ApplicationsCombo'.
/Corp.Security.Web.csproj/Applications/Applications.aspx(18): error ASPPARSE: Unknown server tag 'local:ApplicationsCombo'.
Done building target "AspNetCompiler" in project "Corp.Security.Web.Deploy.wdproj" -- FAILED.
Done building project "Corp.Security.Web.Deploy.wdproj" -- FAILED.
WAP and WDP don't quite work together in a Team Build environment. This is because the OutDir is redirected during a Team Build run. Consequently the WAP .dll is not in the projects ~/bin folder and WDP which is just using the aspnet_compiler.exe can't
find the expected .dlls in the ~/bin.
I did a quick test and you can fix this by modifying your WDP project file. Let's say you have a WDP project building a WAP project named WebApplication1. In the WDP project file you will find a property defined as follows:
This is the path that will be passed to the aspnet_compiler. When OutDir is redefined then this path won't work. Instead you'll need to build agains the WAP output path. That property is not available to WDP but you can compute it.
Replace the line above with this new defination for <SourceWebPhysicalPath>
What this is doing is saying if the OutDir no longer matches the OutputPath, ie. it was redefined then set the SourceWebPhysicalPath to be where the WAP proejct is going to copy its files.
If OutDir was not renamed then the above code will set it to the origional value.
Thank you for your response; this seems to be a much better solution than the hack I had figured out; which is to add the following to the WAP's after build target:
The problem with my approach is that it relies on changing the WAP's csproj which I don't like doing as it is the project other developers work with.
I like your approach since I can only change the WDP which is in an isolated build solution.
I still have a problem though, whenever I replace the line of code you indicated, the build fails complaining about: _PublishedWebsites\Corp.Security.Web not existing.
ASPNETCOMPILER : error 1003: The directory 'c:\TFSBuilds\Corp.Security\Corp.Security.WeeklyDevTestBuild\Binaries\Release\_PublishedWebsites\Corp.Security.Web' doesn't exist.
So I tried to compile the WAP project by itself (without building the WDP) and it seems the WAP doesn't copy all its files to \_PublishedWebsites\ with a successful install. Is that supposed to be its normal behavior? can you think of any reason why it is
not copying the contents to the _PublishedWebsites folder although the build is successful? I can see the .dlls build by WAP in the Binaries\Release folder. Please let me know if this question has to go to the WAP forum.
If you don't have this then you somehow have an old targets file. Be sure to check both your dev machine .targets file and the Team Build server .targets file. It's possible that the .targets file on your Team Build machine could be from one of the Betas.
Thanks Bradley; it seems I had an older version of WAP or the targets were just not installed. WAP now compiles properly
I am still getting a few errors regarding loading server controls that are available in separate assemblies though; I have these registered in the web.config:
ZeroCoolJr
Member
10 Points
2 Posts
With Web Deployment Project
May 18, 2006 08:58 AM|LINK
Does the Web Application Project supports compiling pages on its own dll?
I tried using the Web Deployment Project with a WebSite Project and it seems it can compile the pages into their own dll. But with the Web Application Project, the option "Create a separate assembly for each page and control output" doesn't work. It this how it is supposed to work? By the way, the output of the Web Deployment Project is only the Primary Output of the Web Application Project excluding the Content Files. I thought the output of the Web Deployment Project is the deployable part?
Please point me to the right direction or to where I can get some information about this.
Thanks.
BradleyB
Participant
1197 Points
230 Posts
Microsoft
Re: With Web Deployment Project
May 19, 2006 03:07 PM|LINK
Excellent question. Web Deployment Projects leverage two utilities aspnet_compiler.exe and aspnet_merge.exe.
aspnet_compiler.exe ships with the 2.0 Fx and pre-compiles an entire web site using the same compilation system as ASP.NET. Instead of just caching the pre-compiled bits into the ASP.NET temporary files folder it puts the files into re-deployable folder.
aspnet_merge.exe is a utility that ships with Web Deployment Projects. Because the aspnet_compiler.exe produces numerous assemblies, this utility offers various options to merge the aspnet_compiler generated assemblies into a smaller set of assemblies or even a single assembly.
So how does this relate to Web Application Projects?
Web Application Projects allows you to pre-compile the code behind and other classes with Visual Studio 2005 into a single assembly and supply this assembly as an input in the ASP.NET compilation process by putting it in the ~/bin folder.
When using WAP there are two stages to the compilation process. (This is the same as VS03). The first stage is to use VS to compile all the code behind and other classes into a single assembly and deploy it to the ~/bin folder. All the code in the .aspx, .ascx, .master, etc.. is always generated and compiled by ASP.NET, either dynamically during an http request or when using the aspnet_compiler.exe.
When ASP.NET is generating the code for each page, it’s looking at the “<%@ Page” directive and either seeing CodeFile="file" or CodeBehind="file". This is a key distinction. If it’s a CodeFile attribute ASP.NET knows it’s responsible for the compilation of the code behind code. This is what is used for Web Site projects included in VS05. If it’s a CodeBehind attribute ASP.NET knows the code behind has already been compiled and all it has to do is derive the page class from an already compiled code behind assembly. This is what is used in Web Application Projects and VS03.
Finally, I’m going to attempt to answer your question about Web Deployment Projects and assemblies per page. The ability to produce an assembly per page is a feature of the ASP.NET compilation system. When it is compiling pages it has the ability to batch pages together when generating an assembly or to generate an assembly per page. That is provided ASP.NET is doing the compilation. In the case of Web Application Projects the code behind for the pages have already been compiled into a single assembly. All ASP.NET has left to do is to generate the code for each page/control and generate the assemblies for those. If you’ve decided to make the deployable site updateable then the aspnet_compiler won’t even do that so the pages/controls can be edited and dynamically recompiled on the site. If it’s not updateable you can still get an assembly per page containing just the page class generated by ASP.NET and not the code behind since it’s already been compiled by VS.
I apologize for such as long winded reply but understanding what is being compiled when really helps understand the deployment options.
Hope this helps
Brad.
ZeroCoolJr
Member
10 Points
2 Posts
Re: With Web Deployment Project
May 22, 2006 01:55 AM|LINK
By the way, I was hoping that instead sending the whole website for an update, I only need to send the pages/dlls that are only updated cutting unnecessary downloading/uploading files. Or do you have any suggestion implementing this `plug n play` sort of deployment? Or is this possible with ASP.NET without a downtime or a server restart?
Thanks,
Win
jcnovoa
Member
22 Points
10 Posts
Re: With Web Deployment Project
May 22, 2006 05:52 AM|LINK
BradleyB
Participant
1197 Points
230 Posts
Microsoft
Re: With Web Deployment Project
May 22, 2006 11:57 PM|LINK
Web Application Projects always compile the entire project into a single assembly. The only way to truly get an assembly per page (complete with it's code behind file) is to use a Web Site project and a Web Deployment project.
I suspose that if you use inline code for all your pages and not code behind the yes you could generate a seperate assembly for every page in a WAP project but that kind of defeats the purpose.
As far as multiple languages, That's a cool feature of Web Sites and dynamic compilation. I know that some developers are factoring their sites up into several WAP projects all building into the same bin. Each project is a seperate assembly. While not an assembly per page is does give you the ablity to factor you site into seperate serviceable units. The other nice thing is that each project could be in a different language from the others. While not mixing languages within a project you are using multiple projects within a Site.
Hope this helps,
Brad.
maharik
Member
30 Points
6 Posts
Re: With Web Deployment Project
May 23, 2006 05:37 AM|LINK
Bradley,
How does the build process get affected when using a Web Deployment Project with the Web Application Project in a team build environment?
I am choosing the option of merging all the dlls into one in the web deployment project (which I believe is supported for the WAP?) but I am having a weird error related to type loading when trying to run a standard team build for the WDP project. In visual studio, the solution builds fine and the WDP does seem to play well with the WAP. Based on the errors, it seems that the WDP AspNetCompiler target is having problems loading user controls used on my pages. User controls are defined in a separate folder and namespace in the WAP.
Here is a sample ascx heading of one of my controls:
<%
@ Control Language="C#" AutoEventWireup="true" Inherits="Corp.Security.Web.Controls.ApplicationsCombo" Codebehind="ApplicationsCombo.ascx.cs" %>And a sample registration from one of the pages that use the control:
<%
@ Register TagName="ApplicationsCombo" TagPrefix="local" Src="~/Controls/ApplicationsCombo.ascx" %>The errors from the team build are below. I would really appreciate any help on this.
Thanks
Mario
The errors I get when doing a team build are:
Target AspNetCompiler:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /Corp.Security.Web.csproj -p c:\TFSBuilds\Corp.SecIt\Corp.Security.WeeklyDevTestBuild\Sources\Applications\Corp.Security\Corp.Security.Web -u -f c:\TFSBuilds\Corp.SecIt\Corp.Security.WeeklyDevTestBuild\Binaries\Release\_PublishedWebsites\Corp.Security.Web.Deploy\
/Corp.Security.Web.csproj/SecurityLogin.aspx(1): error ASPPARSE: Could not load type 'SecurityLogin'.
/Corp.Security.Web.csproj/Controls/CompaniesCombo.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.CompaniesCombo'.
/Corp.Security.Web.csproj/Controls/ApplicationsCombo.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.ApplicationsCombo'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/SecurityLogin.aspx(46): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/EditApplication.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.EditApplication'.
/Corp.Security.Web.csproj/Applications/EditApplication.aspx(3): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/CreateApplication.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.CreateApplication'.
/Corp.Security.Web.csproj/Applications/CreateApplication.aspx(3): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/AddUsersToApplication.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.AddUsersToApplication'.
/Corp.Security.Web.csproj/Applications/AddUsersToApplication.aspx(5): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(1): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/WebsiteVersion.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.WebsiteVersion'.
/Corp.Security.Web.csproj/CorpSecurityMasterPage.master(30): error ASPPARSE: Unknown server tag 'local:WebsiteVersion'.
/Corp.Security.Web.csproj/Applications/Applications.aspx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Applications.Applications'.
/Corp.Security.Web.csproj/Applications/Applications.aspx(2): error ASPPARSE: Could not load type 'CorpSecurityMasterPage'.
/Corp.Security.Web.csproj/Controls/ApplicationsCombo.ascx(1): error ASPPARSE: Could not load type 'Corp.Security.Web.Controls.ApplicationsCombo'.
/Corp.Security.Web.csproj/Applications/Applications.aspx(18): error ASPPARSE: Unknown server tag 'local:ApplicationsCombo'.
Done building target "AspNetCompiler" in project "Corp.Security.Web.Deploy.wdproj" -- FAILED.
Done building project "Corp.Security.Web.Deploy.wdproj" -- FAILED.
BradleyB
Participant
1197 Points
230 Posts
Microsoft
Re: With Web Deployment Project
May 24, 2006 01:23 AM|LINK
WAP and WDP don't quite work together in a Team Build environment. This is because the OutDir is redirected during a Team Build run. Consequently the WAP .dll is not in the projects ~/bin folder and WDP which is just using the aspnet_compiler.exe can't find the expected .dlls in the ~/bin.
I did a quick test and you can fix this by modifying your WDP project file. Let's say you have a WDP project building a WAP project named WebApplication1. In the WDP project file you will find a property defined as follows:
<SourceWebPhysicalPath>..\WebApplication1</SourceWebPhysicalPath>
This is the path that will be passed to the aspnet_compiler. When OutDir is redefined then this path won't work. Instead you'll need to build agains the WAP output path. That property is not available to WDP but you can compute it.
Replace the line above with this new defination for <SourceWebPhysicalPath>
<SourceWebPhysicalPath Condition="'$(OutDir)' != '$(OutputPath)'">$(OutDir)_PublishedWebsites\WebApplication1</SourceWebPhysicalPath>
<SourceWebPhysicalPath Condition="'$(OutDir)' == '$(OutputPath)'">..\WebApplication1</SourceWebPhysicalPath>
What this is doing is saying if the OutDir no longer matches the OutputPath, ie. it was redefined then set the SourceWebPhysicalPath to be where the WAP proejct is going to copy its files.
If OutDir was not renamed then the above code will set it to the origional value.
Hope this helps,
Brad.
maharik
Member
30 Points
6 Posts
Re: With Web Deployment Project
May 24, 2006 03:24 AM|LINK
Bradley,
Thank you for your response; this seems to be a much better solution than the hack I had figured out; which is to add the following to the WAP's after build target:
<Target Name="AfterBuild">
<Exec Command="xcopy /y "$(TargetDir)*.dll" "$(ProjectDir)bin\"" />
</Target>
The problem with my approach is that it relies on changing the WAP's csproj which I don't like doing as it is the project other developers work with.
I like your approach since I can only change the WDP which is in an isolated build solution.
I still have a problem though, whenever I replace the line of code you indicated, the build fails complaining about: _PublishedWebsites\Corp.Security.Web not existing.
ASPNETCOMPILER : error 1003: The directory 'c:\TFSBuilds\Corp.Security\Corp.Security.WeeklyDevTestBuild\Binaries\Release\_PublishedWebsites\Corp.Security.Web' doesn't exist.
So I tried to compile the WAP project by itself (without building the WDP) and it seems the WAP doesn't copy all its files to \_PublishedWebsites\ with a successful install. Is that supposed to be its normal behavior? can you think of any reason why it is not copying the contents to the _PublishedWebsites folder although the build is successful? I can see the .dlls build by WAP in the Binaries\Release folder. Please let me know if this question has to go to the WAP forum.
Once again, thank you for your help.
Mario
BradleyB
Participant
1197 Points
230 Posts
Microsoft
Re: With Web Deployment Project
May 24, 2006 04:42 PM|LINK
Take a look at Microsoft.WebApplication.targets.
You should the following PropertyGroup.
<PropertyGroup>
<WebProjectOutputDir Condition="'$(OutDir)' != '$(OutputPath)'">$(OutDir)_PublishedWebsites\$(MSBuildProjectName)</WebProjectOutputDir>
<WebProjectOutputDir Condition="'$(OutDir)' == '$(OutputPath)'">$(MSBuildProjectDirectory)</WebProjectOutputDir>
</PropertyGroup>
If you don't have this then you somehow have an old targets file. Be sure to check both your dev machine .targets file and the Team Build server .targets file. It's possible that the .targets file on your Team Build machine could be from one of the Betas.
maharik
Member
30 Points
6 Posts
Re: With Web Deployment Project
May 25, 2006 05:52 AM|LINK
Thanks Bradley; it seems I had an older version of WAP or the targets were just not installed. WAP now compiles properly
I am still getting a few errors regarding loading server controls that are available in separate assemblies though; I have these registered in the web.config:
<
pages theme="StandardTheme"><
controls><
add tagPrefix="data" namespace="Corp.Security.WebUtilities.Data" assembly="Corp.Security.WebUtilities"/><
add tagPrefix="ui" namespace="Corp.Security.WebUtilities.UI" assembly="Corp.Security.WebUtilities"/><
add tagPrefix="corpgrid" assembly="Corp.Common.WebControls" namespace="Corp.Common.WebControls.MultiCheckGridView"/><
add tagPrefix="corp" assembly="Corp.Common.WebControls" namespace="Corp.Common.WebControls" /> </controls></
pages>And the errors I get are all related to these controls:
/Oakleaf.Security.Web.csproj/OakleafSecurityMasterPage.master(51): error ASPPARSE: Unknown server tag 'oakleaf:OakleafNotificationLabel'.
/Oakleaf.Security.Web.csproj/Applications/AddUsersToApplication.aspx(28): error ASPPARSE: Unknown server tag 'oakleafgrid:MultiCheckGridView'.
/Oakleaf.Security.Web.csproj/Applications/AddUsersToApplication.aspx(53): error ASPPARSE: Unknown server tag 'data:EntityDataSource'.
Is there a reason why this would happen? do you recommend a better way of referencing these server controls?
Thanks