We are currently trying to setup an Angular 2 project that also contains a Cloud Service project in its solution. We have set up numerous Angular 1 projects containing Cloud Service projects and have had no errors. When trying to run the MSBuild step for the Angular 2 project, we get the following error on the TeamCity build server:
C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\Windows Azure Tools\\2.7\\Microsoft.WindowsAzure.targets(2787, 5): error MSB3021: Unable to copy file "C:\\TeamCityBuildAgent\\temp\\buildTmp\\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" to "C:\\SourceControlFolder\\Apps\\MyApp\\MyApp.CloudDeployment\\obj\\Debug\\Website\\C:\\TeamCityBuildAgent\\temp\\buildTmp\\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs". The given path's format is not supported.
The main problem seems to be the build attempting to throw the full C:\\TeamCityBuildAgent..
path into the obj\\Debug\\Website
folder.
My current MSBuild parameters are: /p:Configuration="Dev" /p:platform="Any CPU" /p:OctoPackEnforceAddingFiles=true /p:OctoPackProjectName=MyApp_Dev
I've tried the following solutions:
Curious if anyone else has experienced this error and knows a fix. I'll keep this post updated as I try other solutions.
Update
It appears that what is causing this issue is this line within the .csproj file: <FilesToIncludeForPublish>AllFilesInProjectFolder</FilesToIncludeForPublish>
This is specified for our build configurations to copy all files generated by the ng build to the output directory of the publish. What I don't understand at the moment is how this works on all of the devs' local machines but does not work on our build server. Will keep this posted as I find more info or any kind of workaround.
This ended up being the fix:
Instead of targeting the .sln in MSBuild, we specifically targeted the .csproj file. This fixed the build errors and allowed us to keep the FilesToIncludeForPublish
tag inside.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.