locked
Missing section appSettings RRS feed

  • Question

  • User-953368566 posted

    I've upgraded to WDP for 2008 and get this error on build:

    web.config(1): error WDP00002: missing section appSettings.

    It was working in 2005.

    I notice that the files are put into a folder called TempBuildDir instead of the Output Folder that I specified in the configuration. I've never seen this folder before (in WDP 2005).

     

    Sunday, December 2, 2007 8:17 PM

Answers

  • User-953368566 posted

    Ok I fixed the problem. You need to add this to the MSBuild project file. It's basically a copy from the AfterBuild target in the main WDP MSBuild file. Surely this has got to be a bug!

    <Target Name="AfterMerge">

    <CreateItem Include="$(TempBuildDir)\**\*.*">

    <Output ItemName="CompiledFiles" TaskParameter="Include" />

    </CreateItem>

    <Exec Command="if exist &quot;$(WDTargetDir)&quot; rd /s /q &quot;$(WDTargetDir)&quot;" />

    <Exec Command="if not exist &quot;$(WDTargetDir)&quot; md &quot;$(WDTargetDir)&quot;" />

    <Copy SourceFiles="@(CompiledFiles)" DestinationFolder="$(WDTargetDir)\%(CompiledFiles.SubFolder)%(CompiledFiles.RecursiveDir)" />

    <Exec Command="if exist &quot;$(TempBuildDir)&quot; rd /s /q &quot;$(TempBuildDir)&quot;" />

    </Target>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, December 2, 2007 11:50 PM

All replies

  • User1001868398 posted

    Can you post your web.config?

    Sunday, December 2, 2007 9:42 PM
  • User-953368566 posted

    My web.config contains <appSettings> and so do the replacement files. This was working in 2005, so it's something about the new 2008 WDPs.

    I've discovered that it puts the files in a directory called TempBuildDir but then doesn't copy them to the Output Directory. If I set the Output Directory to actually be TempBuildDir, then it works, but this is not an ideal solution.

    Sunday, December 2, 2007 9:53 PM
  • User-953368566 posted

    Let me reword: 

    I'm trying to use the new 2008 WDP (December CTP)

    It builds and merges the files and puts them into a folder called TempBuildDir. When it gets to the "ReplaceConfigSections" target, it errors:

    missing section appSettings

    Investigating further, it is looking for the web.config file in the Output Folder (in this case " ./Test/ "), which hasn't even been created yet.

    It seems that WDP puts the compiled and merged files into a folder called TempBuildDir and then fails to copy its contents to the "Output Folder". Thus, the ReplaceConfigSections target is looking for files that don't exist.

    Note that if I change the "Output Folder" to be ./TempBuildDir everything works fine. This is not ideal because I have multiple solution configurations.

    Sunday, December 2, 2007 10:13 PM
  • User-953368566 posted

    Ok I fixed the problem. You need to add this to the MSBuild project file. It's basically a copy from the AfterBuild target in the main WDP MSBuild file. Surely this has got to be a bug!

    <Target Name="AfterMerge">

    <CreateItem Include="$(TempBuildDir)\**\*.*">

    <Output ItemName="CompiledFiles" TaskParameter="Include" />

    </CreateItem>

    <Exec Command="if exist &quot;$(WDTargetDir)&quot; rd /s /q &quot;$(WDTargetDir)&quot;" />

    <Exec Command="if not exist &quot;$(WDTargetDir)&quot; md &quot;$(WDTargetDir)&quot;" />

    <Copy SourceFiles="@(CompiledFiles)" DestinationFolder="$(WDTargetDir)\%(CompiledFiles.SubFolder)%(CompiledFiles.RecursiveDir)" />

    <Exec Command="if exist &quot;$(TempBuildDir)&quot; rd /s /q &quot;$(TempBuildDir)&quot;" />

    </Target>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, December 2, 2007 11:50 PM
  • User1618900539 posted

     Thanks aboreham,

    I was having the same problem: It ran in VS2005 and it won't in VS2008 because it couldn't find the source file to replace the web.config section.

    Using your workaround it's working now, I agree it must be a bug.

     

    Cheers,


     

    Monday, December 3, 2007 5:10 PM
  • User1070236303 posted

    I've just encountered this bug.

    Web config replacement simple not works without the workaround. It's strange that an important feature simple not works at all even when wdp is ctp... but why is it only in ctp phase?!

    Friday, December 7, 2007 6:36 AM
  • User2006178999 posted

    Drats :( I get the _same_ error .. but the work around fails for me :(  I'm running this on windows x64 bit though .. i wonder if that's an issue?

    Very upsetting! I cannot deploy any projects now until this is resolved! :(

    Here's a snapshot of the error log...

    Running aspnet_merge.exe.
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\aspnet_merge.exe .\TempBuildDir -o MyProject.WebSite -a -debug -r -copyattrs 
    Successfully merged '.\TempBuildDir'.
    if exist "R:\Visual Studio Projects\MyProject\Deployment\Development Server\Debug\" rd /s /q "R:\Visual Studio Projects\MyProject\Deployment\Development Server\Debug\"
    if not exist "R:\Visual Studio Projects\MyProject\Deployment\Development Server\Debug\" md "R:\Visual Studio Projects\MyProject\Deployment\Development Server\Debug\"
    if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
    R:\Visual Studio Projects\MyProject\Deployment\Development Server\Server Deployment.wdproj(246,5): error MSB3021: Unable to copy file ".\TempBuildDir\AvatarHandler.ashx" to "\\192.168.8.82\MyProject\AvatarHandler.ashx". Could not find a part of the path '.\TempBuildDir\AvatarHandler.ashx'.
    R:\Visual Studio Projects\MyProject\Deployment\Development Server\Server Deployment.wdproj(246,5): error MSB3021: Unable to copy file ".\TempBuildDir\Default.aspx" to "\\192.168.8.82\MyProject\Default.aspx". Could not find a part of the path '.\TempBuildDir\Default.aspx'.
    ... plent more errors of the same type....
     

     

    I could cry :(

    Thursday, December 20, 2007 7:25 PM
  • User-1585123517 posted

    I had the same problem as pure.krome. Resolved it by removing the delete folder command.

    <Exec Command="if exist &quot;$(TempBuildDir)&quot; rd /s /q &quot;$(TempBuildDir)&quot;" />

    It appears that this is already deleted by another part of the script. 

     

    Wednesday, January 23, 2008 5:16 PM
  • User1618900539 posted

    All of this has been fixed in the last build, so we should except to not have any of these issues in the final release,

     Cheers,

    Wednesday, January 23, 2008 5:24 PM
  • User1070236303 posted

    All of this has been fixed in the last build, so we should except to not have any of these issues in the final release,

    What is the expected release time?

    Thursday, January 24, 2008 3:33 AM
  • User1701205490 posted

    All of this has been fixed in the last build, so we should except to not have any of these issues in the final release,

     Cheers,

     

    I second the request above. Is it being released anytime soon?
     

    Friday, January 25, 2008 6:45 AM
  • User1618900539 posted

    I've no idea guys, I just tried the build that the WDP made available some days ago.

    You would need to contact them for a date

    Saturday, January 26, 2008 12:19 AM
  • User1070236303 posted

    I've no idea guys, I just tried the build that the WDP made available some days ago.
     

    If anybody interested the new version is here: Announcing RTW version of Visual Studio 2008 Web Deployment Projects (WDP)

    and

    http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en

    Monday, January 28, 2008 2:58 AM
  • User1701205490 posted

    I've no idea guys, I just tried the build that the WDP made available some days ago.
     

    If anybody interested the new version is here: Announcing RTW version of Visual Studio 2008 Web Deployment Projects (WDP)

    and

    http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en

     

    Thanks a lot! 

    Monday, January 28, 2008 3:08 AM
  • User1070236303 posted

     Just tested and in the rtw version this bug is corrected, so the aftermerge workaround is not necessary.

    Thursday, April 3, 2008 10:58 AM
  • User-319574463 posted

     I have faced a similar problem where of 10 projects that all built interactively in VS2008 Sp1 Team version, 9 built ok as teamBuilds but 1 failed with the following error:

    C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets(60,3): error MSB3021: Unable to copy file "bin\AjaxControlToolkit.dll" to "C:\Documents and Settings\FREDService\Local Settings\Temp\FRED3\FRED.SOMETHING\Binaries\Release\_PublishedWebsites\External\bin\AjaxControlToolkit.dll". Could not find file 'bin\AjaxControlToolkit.dll'.

    I am puzzled why 1 out of 10 team builds should fail.

    Wednesday, September 10, 2008 11:26 AM