I am using Visual Studio 2012 to publish a web site to an IIS server farm. The problem I ran into is that the publishing process would only work if it happened to get routed to the primary server.
My solution was to temporarily stop the secondary server so that the publishing request would have to go to the primary server. This is, obviously, not an ideal solution. Is there a way I can force the publishing request to go to the primary server? Or is there a better way to deal with this problem?
If you are using DFS Replication, as you've indicated in the comments, then you don't have a mesh replication topology configured, you have a hub and spoke with your "primary" server being the hub and all of your other web servers being the spokes with one-way replication configured from hub to spoke. The easiest way to resolve this issue is to make the replication bi-directional mesh (or at the very least a bi-directional hub-and-spoke) so that it doesn't matter which server you make a change on. A mesh topology is more fault tolerant than a hub and spoke at 3 or more servers.
The other alternative is to configure Visual Studio to connect directly to the "primary" server, instead of using the web farm name. The web farm name is likely a virtual name on a load-balancer or a round-robin DNS name. Take that out of the equation and connect directly to whichever server you've designated as the "primary" in the farm.