Intermittent FTP publish issue in VS2010 - visual-studio-2010

I am using the build in publishing tools of VS2010. I use this for a number of sites, however I have one that is occasionally problematic. I have everything saved and when I publish for the first time it always succeeds. Then when I go to publish again I get a successful build, but a failed publish. Note that the publish directory is a sub-directory, as that is the structure of the hosting company.
Connecting to ftp://www.website.com/Html/...
Unable to open the Web site 'ftp://www.website.com/Html'. There is no site named "Html".
========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
If I close VS and restart it works. I feel this is probably a bug, but wanted to see if anyone else has had that experience and/or a fix.

This was an issue with the host. Placed a ticket with them and they resolved. Do not know what resolution, but non-issue.

Related

TeamCity sometimes building incorrectly

I have TeamCity set up to build some Visual Studio solutions and package them into an artifact. This works just fine most of the time.
However, once in a while (maybe 1 in 100 builds), the files built from TeamCity does not run. We use a lot of dependency injection in our code and some times our application refuses to start because it can't find the correct dependencies in the files. There are no missing files in the artifact, though.
We then force TeamCity to build everything once more (by adding a new line to a file and commiting it), and suddenly our application starts again.
It is then obvious to me that there is something TeamCity has not built correctly, though I'm unable to discover what it is, as all the build logs report no errors or warnings of any kind.
What can cause this strange behavior, and what can I do to prevent it from happening in the future (or what can I turn on to get more extensive logging to try to find out what happens when it fails)?
Check the errors when Team City does not run. Does it say why it cannot run? Sometimes have Team City fail a build simply because the version control system had a hiccup. Based on the error in Team City's log it can be obvious that it was only because of that. If you do not do clean builds try doing that and seeing if it makes the intermittent problems go away.

Visual Studio Team Services Could not load file or assembly 'classlibrary' or one of its dependencies when changed to build branch solution

We've got an agent build working on the main development branch from Visual Studio Team Services (VSTS).
With our agent build configuration set as:
This is working fine, the build agent picks up the source and builds.
Now, I want to make the build agent build the R5 code which is identical to the Main Dev Trunk code - newly created branch.
So in VSTS I change the folder to build to:
When a file is checked in it triggers the build. It builds no problem.
But for some reason I getting this error when loading the website.
"Could not load file or assembly 'classlibxxxx, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified."
The code is identical, so must some setting in VSTS?
Do I need to change anything else in VSTS, is the path correct, or what else could it be?
UPDATE - what I do notice now is that the log is telling me it is download all the sources (even for the previous R1-R4 releases)
Okay! Since it's way TL/DR to wade through the, what I'm finding is very poor, documentation for VSTS... Here is what was causing it:
The mystic _work directories of the agent... E.g. c:\agent\1,2 etc. are NOT output directories.
The website had been pointed to one of these folders and by some fluke must have been working.
What is needed is another step in the Build Definition to actually place the compiled files into something meaningful.
You need to supply an Admin Username and password even if it on a drive local to the Agent.
But hey presto, after 6hrs of madness... all the projects are lined up and will run without issue.

TeamCity fails to publish artifacts, but build goes green?

After moving a few files to new directories, our main TeamCity build started complaining about a missing artifact path("Artifacts path 'some/path/*.tar.gz' not found"), and dependent builds would fail. In my opinion, dependent builds should not even have been started, because the main build failed - but TeamCity reports those builds as successful (green). This doesn't exactly make finding the problem easier, and I would prefer that the build go red if the artifacts cannot be published. How?
You can add new failure condition when output logs matches regex:
Artifacts path .+ not found
This depends on 2 factors
The part of the code which publishes artefacts did not publish a non-zero exit code that teamcity could translate into a build failure. You should probably open up a ticket for them
You can also define your custom build failure conditions in the "Build failure" settings. You can cause the build to fail if artefacts cannot be published

TeamCity REST API to get list currently broken projects

Using TeamCity 8.0.4 (build 27616)
I use a call to my TeamCity server to get a list of broken builds:
http://teamcity.exactbid.net/guestAuth/app/rest/builds/?locator=status:failure,sinceBuild:(status:success)
If I a project is in the failure state, that API call returns count =1 and the details of the broken project.
The problem is if that project has a currently running build, the API call returns count 0 and no projects in the broken list.
As soon as the project build finished (and breaks again) the count goes back to 1.
So hopefully there is something in my locator query that I can change to get broken builds even if they are currently building.
The TC ui seems to know about it because the parent projects of my broken project all show red. Just not sure how to get it right in the API query.
Try adding running:any. Maybe running defaults to false, although I can't find that in the documentation.
Here's how to display a list of failed builds:
http://teamcity.exactbid.net/guestAuth/app/rest/builds/?locator=status:failure
Failed builds are builds that have already finished and failed, what I think you are looking for is a way of showing builds that are running and failing:
http://teamcity.exactbid.net/guestAuth/app/rest/builds/?locator=status:error,status:running
This looks for builds that are running and contain errors (which cause the build to fail, unless explicitly told not to)
You may have to use two REST API calls to get the builds:
that are finished and failed
that are running and failing

MSBuild reports that build Failed however the log reports Build Successful

I'm having trouble with an MSBuild script as it's executing correctly, but in TFS Build Explorer it reports a Fail (red X icon). However, despite all the builds reporting failed, if I examine the logs, they look fine, and end with :
Done building target "EndToEndIteration" in project "TFSBuild.proj".
Done Building Project "C:\Builds\EDRM Development\CI_Development_IW471_UserGroup_CG3\BuildType\TFSBuild.proj" (EndToEndIteration target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
What exactly is Build Explorer using to determine the success of the build script ?
The script itself is using the MSBuild Extension Pack (from CodePlex) to build a solution containing 40+ VB6 projects. So that it can be run by team build, i've implemented target EndToEndIteration, with the build target as a 'DependsOnTargets'. EndToEndIteration is the only one of team build's targets that I have implemented in the script (it appears to be the only mandatory one ?).
When i run the script from the command line it reports success also, so it's only Build Explorer that's indicating a failure.
Any ideas why this is happening ?
The success of the build is determined by ALL Tasks ended with success pattern (if one fails it may be consider as partially succeed build, but the icon will still remain as a failure icon with small green success icon:)
Try to look at build log's, because it seems, that some pre or past run steps are failing (unable to copy sth, etc). The easiest way is to determine where the problem is, is to schedule the build from Visual Studio with maximum verbosity level for each Task.
Thanks for the reply. All tasks were ending with success.
I've just found out the solution though, so I'll add it here.
As I'm building a VB6 solution (comprising 40+ projects), I'd created a pure msbuild script, that i'd originally been running from the command line. To use it with team build for CI, i'd added a target "EndToEndIteration" as this is the only mandatory target for a new msbuild script in team build (i.e. a script not created via TFS's create build script wizard). This results in the problem above, where even if the script executes perfectly, build explorer still reports failure.
The solution is to create a build script using the TFS wizard (for any .Net .sln file - it doesn't matter - the reference to it will be deleted). Then take a copy of this tfsbuild.proj file and strip out the details relating to the .Net project and paste in your msbuild targets. Then implement target "CoreCompile" to initiate the targets you pasted in.

Resources