From: Chuck on
I converted a solution from 08 to 10.

All my after build tasks don't run. This is the first one.
<Target Name="AfterBuild">
<RemoveDir Directories="$(OutputPath)/ConfigFiles" />
</Target>

I don't get errors or anything

This is what the Output screen shows:
Running aspnet_merge.exe.
aspnet_merge : warning 1013: Cannot find any assemblies that can be merged
in the application bin folder.
Successfully merged 'obj\Test\TempBuildDir'.
Updating web.config: RootPath = \\hrIntTest\E$\Inetpub\wwwroot\VTC\,
ValidateSections = True, UseExternalConfigSource = False
Update of web.config Succeeded.
========== Build: 2 succeeded or up-to-date, 0 failed, 1 skipped ==========
From: Zhi-Qiang Ni[MSFT] on
Hi Chuck,

After some effort on your issue, we do not find anything cause it.

What we did:

1. Use VS 2008 SP1 create a C# web application

2. Add follow lines in project file:

<target Name="AfterBuild">

<MakeDir Directories="$(OutputPath)/ConfigFiles" />

</target>

3. Save the project file.

4. open the project by VS2010 RTM

5. Convert into .Net Framework 4.0(optional)

6. build the project.

7. there is a \bin\ConfigFiles

--
Sincerely,
Zhi-Qiang Ni
Microsoft Online Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================

From: Chuck on

Looks like I had two AfterBuild tasks defined in xml.
One of the conditions had been removed.
I guess if you have two only the last one runs.
I moved the actual work from both into one and then it ran.

From: Chuck on
Little more investigating. If I try to limit the Exec task to only test
build conditions. Nothing works.

this works
<Target Name="AfterBuild" >
<RemoveDir Directories="$(OutputPath)/ConfigFiles" />
<Exec WorkingDirectory="$(OutputPath)"
Command="$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0(a)MSBuildToolsPath)aspnet_regiis.exe
-pef connectionStrings $(OutputPath) -prov HrCustomProvider" />

</Target>



This does not


<Target Name="AfterBuild" >
<RemoveDir Directories="$(OutputPath)/ConfigFiles" />
</Target>


<Target Name="AfterBuild" Condition="'$(Configuration)|$(Platform)' ==
'Test|AnyCPU'">
<Exec WorkingDirectory="$(OutputPath)"
Command="$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0(a)MSBuildToolsPath)aspnet_regiis.exe
-pef connectionStrings $(OutputPath) -prov HrCustomProvider" />
</Target>

From: "Steven Cheng" on
Hi Chuck,

So the build event still only run one of the <target Name="AfterBuild" >
but ignore the others? What if you only put a single <target > which set
the Condition to "Test" build(and put all the commands in that <target>)?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


--------------------
>From: =?Utf-8?B?Q2h1Y2s=?= <nospam34(a)nospam.nospam>
>References: <7B1D38BB-3798-4C29-9ADE-2E01FAEBFFBA(a)microsoft.com>
<xSg9bX1FLHA.2364(a)TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: 2010 WebDeployment after build don't execute
>Date: Tue, 29 Jun 2010 15:19:34 -0700

>
>Little more investigating. If I try to limit the Exec task to only test
>build conditions. Nothing works.
>
>this works
> <Target Name="AfterBuild" >
> <RemoveDir Directories="$(OutputPath)/ConfigFiles" />
> <Exec WorkingDirectory="$(OutputPath)"
>Command="$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVers
ions\2.0(a)MSBuildToolsPath)aspnet_regiis.exe
>-pef connectionStrings $(OutputPath) -prov HrCustomProvider" />
>
> </Target>
>
>
>
>This does not
>
>
> <Target Name="AfterBuild" >
> <RemoveDir Directories="$(OutputPath)/ConfigFiles" />
> </Target>
>
>
> <Target Name="AfterBuild" Condition="'$(Configuration)|$(Platform)' ==
>'Test|AnyCPU'">
> <Exec WorkingDirectory="$(OutputPath)"
>Command="$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVers
ions\2.0(a)MSBuildToolsPath)aspnet_regiis.exe
>-pef connectionStrings $(OutputPath) -prov HrCustomProvider" />
> </Target>
>
>