Problems with long path in TFS Team Build when Cre

2019-04-07 02:20发布

We have a problem by build because of long path created by TFS Team Build when parameter CreatePackageOnPublish is set to true.

In directory PackageTmp (see picture later) the package is stored, but I don't understand why this directory structure is necessary and how it can be customized.

The problem is that the deployment or new TFS build generates error because of long path.

I will be grateful for your help.

Regards

Anton Kalcik

This is the (anonymised) tree structure created by TFS Team Build:

enter image description here

1条回答
淡お忘
2楼-- · 2019-04-07 03:11

An easy workaround is to create the 'PackageTmp' folder as a .zip file. To do so right-click on your Project from VS and select 'Package/Publish Settings'. In the 'Web Deployment Package Settings' tick the 'Create deployment package as a .zip file'.


Another workaround is to add the following parameter on your command that runs on Tfs build:

MSBuild.exe WebProjectName.cs /p:Configuration="Release";DeployOnBuild=true;DeployTarget=Package; _PackageTempDir=C:\Package

The _PackageTempDir=C:\Package will create the following output path:

..\WebProjectName_Package\Archive\Content\C_C\Package\..

查看更多
登录 后发表回答