I'll throw my two cents too.
I tried every combination of Clean, Rebuild, Restart, etc. I found that restarting Visual Studio usually fixes the problem for at least one publication. However, the strange part. You can also fix the problem by doing absolutely nothing. If you just let Visual Studio sit for about a minute or two, and then publish, it will work fine. There some kind of von-voodoo is coming here and waiting for its completion, it seems to be doing the trick.
I have a solution with two parts that need to be published. One is the WCF service application, and the other is the ASP.NET MVC5 website. Every time I publish services, and then try to publish a site, I will see this error. I can publish the services, restart VS, and then publish the site, OR . I can publish the service, go have a drink, and then publish the site. As long as I give Sun a chance to "settle" between any re-creation and publication of the site, everything seems to work as expected.
Take a walk, come back, the problem is solved. OR if you do not have time. Clean, rebuild, restart, publish (spread, rinse, repeat).
Mel Dec 04 '14 at 14:21 2014-12-04 14:21
source share