2010 WebDeployment after build don't execute

Discussion in 'ASP .Net' started by Chuck, Jun 25, 2010.

  1. Chuck

    Chuck Guest

    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 ==========
    Chuck, Jun 25, 2010
    #1
    1. Advertising

  2. 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
    ==================================================
    Zhi-Qiang Ni[MSFT], Jun 29, 2010
    #2
    1. Advertising

  3. Chuck

    Chuck Guest

    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.
    Chuck, Jun 29, 2010
    #3
  4. Chuck

    Chuck Guest

    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@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@MSBuildToolsPath)aspnet_regiis.exe
    -pef connectionStrings $(OutputPath) -prov HrCustomProvider" />
    </Target>
    Chuck, Jun 29, 2010
    #4
  5. Chuck

    Steven Cheng Guest

    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=?= <>
    >References: <>

    <>
    >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@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@MSBuildToolsPath)aspnet_regiis.exe
    >-pef connectionStrings $(OutputPath) -prov HrCustomProvider" />
    > </Target>
    >
    >
    Steven Cheng, Jul 12, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sabri Pllana
    Replies:
    0
    Views:
    639
    Sabri Pllana
    Aug 20, 2009
  2. Sabri Pllana
    Replies:
    0
    Views:
    618
    Sabri Pllana
    Aug 20, 2009
  3. wce_2009
    Replies:
    1
    Views:
    1,748
    gandhini
    Sep 17, 2010
  4. Chuck
    Replies:
    2
    Views:
    368
    Chuck
    Jun 30, 2010
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,321
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page