Web deployment project CTP for VS2008 - missing connectionStrings element

Web deployment project CTP for VS2008 - missing connectionStrings element

by Peter Hancock 15. December 2007 23:32

I've installed this morning the web deployment project ctp for VS 2008 and immediately had an error with merging connectionStrings for my release build.  It presents with error WDP00002: missing section connectionStrings.  This is occurring because the project is not copying from the TempBuildDir to the output directory before the merge process.  The result is that it's trying to merge the connection string section into a web.config file that doesn't actually exist.  This should also work for the missing appSettings posted on some of the forums - but I haven't test that

After a bit of research, I thought I'd found the solution here, but had to modify it slightly.  For me, it works when I move it into the AfterMerge target of the deployment project - like thus    

<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>

Hopefully they'll fix this for the release build.

Currently rated 3.5 by 2 people

  • Currently 3.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Software development

Related posts

Comments

December 20. 2007 01:09

Derek

Thanks for the tip! This worked for me as you describe, but I had an extra obstacle as well. I didn't have an AfterBuild target entry in my deployment project (just the AfterMerge target as you show), so I guess my WDP was performing a default action and deleting my target directory.

Derek us

December 20. 2007 02:31

Peter Hancock

It actually builds to temp directory and never copies the resulting files to the output directory. The merge however works on the output directory.... but since it never copies, the whole thing falls down in a screaming heap.

Peter Hancock au

December 24. 2007 14:37

KN

This is what I did to fix the issue - mainly because I did not want to modify the existing deployment projects I already had. I modified the targets file in the MSBuild\Microsoft\WebDeployment\v9.0 folder and moved the code that is under <Target Name="AfterBuild"> to <Target Name="AfterMerge">.

Warning/Note: But doing this will replace the previous success build folder with the files bits even if the config replacement fails or if there is an issue with the virtual folder creation process.

KN us

December 25. 2007 11:13

KN

After further working on the solution I changed my solution as follows

This second workaround involves modifying the .targets file that is created in "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets" web deployment add-in is installed.

Important note: Please backup the file before the edits are done.

1. Open
"C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets"
in your favorite XML editor.
2. Goto line 89 where you should find the following line
<CreateProperty Value=".\TempBuildDir\">
3. Replace that line with a full path value eg
<CreateProperty Value="C:\Temp\WebDeployment\v9.0\TempBuildDir\">
4. Goto line 626 where you should find the line
RootPath="$(WDTargetDir)"
5. Replace that line with
RootPath="$(TempBuildDir)"
6. Save the file.

That should do it.

KN us

December 26. 2007 05:22

Peter Hancock

@KD - nice. I'll be interested to see what they do to fix the RTM version.

Peter Hancock au

January 23. 2008 09:03

trackback

Trackback from Software Cafe

[Visual Studio|WDP] Web Deployment Projects Dec. 2007 CTP の紹介と注意点

Software Cafe

May 8. 2008 16:38

Sheree

I'm trying to track down Peter Hancock who went to Geilston Bay High School

Sheree au

May 8. 2008 17:55

Peter Hancock

Sorry Sheree, not this one :-(

Peter Hancock au

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

November 22. 2008 14:01

Recent posts

Recent comments