Msbuild is not copying web.config file while transformation
Asked Answered
D

1

6

TransformWebConfig folder is empty after msbuild publish. Following is the teamcity log

[09:31:43]: [CollectWebConfigsToTransform] GetPublishingLocalizedString 
[09:31:43]: [GetPublishingLocalizedString] Found The following for Config tranformation:
{0}
[09:31:43]: [it\it.vbproj.teamcity] PipelineTransformPhase 
[09:31:43]: [PipelineTransformPhase] GetPublishingLocalizedString 
[09:31:43]: [GetPublishingLocalizedString] Publish Pipeline Transform Phase 
[09:31:43]: [it\it.vbproj.teamcity] AutoParameterizationWebConfigConnectionStringsCore
[09:31:43]: [AutoParameterizationWebConfigConnectionStringsCore] Skipping target
"AutoParameterizationWebConfigConnectionStringsCore" because it has no inputs. 
[09:31:43]: [it\it.vbproj.teamcity] CopyAllFilesToSingleFolderForPackage (1s) 
[09:31:43]: [CopyAllFilesToSingleFolderForPackage] GetPublishingLocalizedString 
[09:31:43]: [GetPublishingLocalizedString] Copying all files to temporary location below for package/publish:obj\Deploy-Dev\Package\PackageTmp.

Web.config file is present in the directory. Just don't understand why it is not picking it. Also After publishing the destination is containing web.deploy and web.release files instead of web.config file. Please help.

Durno answered 27/7, 2011 at 8:45 Comment(2)
I have a similar issue with app.config. I think this is something to do with the order of {compile, publish, transform}Boozy
I am using following commandline parameters /M /P:Configuration=%env.Configuration% /P:DeployOnBuild=True /P:DeployTarget=MSDeployPublish /P:MsDeployServiceUrl=%env.TargetServer%/MsDeployAgentService /P:MSDeployPublishMethod=RemoteAgent /P:CreatePackageOnPublish=True /P:Username=%env.username% /P:Password=%env.password% and they are working great for other projects its just happening with one project.Durno
D
17

After a few work around, figure out that web.config property was set to Do not Copy, change it to copy always and secondly Build action was set to none, change it to content. Hope it will help someone.

Durno answered 27/7, 2011 at 9:56 Comment(3)
I right clicked on the Web.config > Properties and change the Build action to Conent and Copy to Output Direct to Copy if newerStack
Setting up "Build Action" to Content seems to be the key here. I don't think "Copy always" is required, because it would end up copied into bin directory which is irrelevant.Cockboat
For future readers: This answer is correct, but Subhash comment (comment to this answer) is a tad "more" correct. Thanks to both!Hinch

© 2022 - 2024 — McMap. All rights reserved.