3
votes

in TFS explorer, I found this property under Build Definition Editor -> Process -> Build process parameters -> 6. Publishing -- Azure Website -> Web Deploy Publish Profile:

enter image description here

I downloaded the publish profile, but the TFS build report the following error:

Overall Build Process
Update Build Number
Run On Agent (reserved build agent Hosted Build Agent)
Create Workspace
Get Workspace
Create Label
Compile, Test, and Associate Changesets and Work Items
Compile and Test
Fetch Azure Web Site Publish Profile
Run MSBuild for Project
Built $/myproj/myproj/myproj.sln for default targets.
Built $/myproj/myproj/myproj/myproj.csproj for default targets.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4435): The value for PublishProfile is set to 'myproj.azurewebsites.net', expected to find the file at 'C:\a\src\myproj\myproj\myproj\Properties\PublishProfiles\myproj.azurewebsites.net' but it could not be found.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4449): Target ValidatePublishProfileSettings Failed MSBuild Log File
Handle Exception
Create Work Item
Associate Changesets and Work Items
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
Exception Stack Trace:
at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Drop Files to Drop Location
Work item '4: Build Failure in Build: myproj_2012-55-10_07-55.1' was opened by the build.

2

2 Answers

3
votes

I was having similar issues, there really isn't a lot of documentation on the build settings. I see from your screenshot you are using the .publishsettings file but I couldn't get this to work, instead I think you need a .pubxml file.

Try this:

  • right click on the project and select publish (or publish web site)
  • You will see the publish wizard, on the profile tab select import and choose your file downloaded from the azure portal.
  • Close the wizard. (I published manually the first time, but I don't that is necessary). At this point visual studio should have created 3tow .pubxml files. One for webdeploy and one for ftp.
  • Check this file into source control somewhere
  • select the file using it's source control folder location for step 6 in the first screenshot of your question.

Hope that helps, it solved it for me.

0
votes

'C:\a\src\myproj\myproj\myproj\Properties\PublishProfiles\myproj.azurewebsites.net' but it could not be found.

Do you have a profile located in that directory? That probably is the issue..it needs to be in that directory.