Visual Studio 2012 random build order on F5 deploy


  • We have a solution with 11 projects (SharePoint) that build/deploy fine from Visual Studio 2010. I attempted to build/deploy from Visual Studio 2012, and it fails to build the solution with the usual namespace errors (The type or namespace name '' could not be found (are you missing...)). Doing a Build or Rebuild works perfectly. This issue only occurs when doing an F5 deploy or right clicking the project and choosing deploy.

    The only observsation I have been able to make so far is that Build/Rebuild ALWAYS builds in the same order (as specified in the solutions build order). That is why, as far as I can tell, it always works. However, reviewing the output of the build when pressing F5 or doing a right-click deploy and the build order seems very random. Our common library is building dead last (which, btw, contains most of the namespaces/types that the build complains about).

    Anyone else experience this or know what might be happening?



    Saturday, August 25, 2012 2:07 AM

All replies

  • Hi Paul.

    Thank you trying out VS 2012. Would you please share with us a test solution that can reproduce the problem? I'm not aware of such problem so far. That would be very helpful.

    btw, Skydrive is an ideal place for sharing:


    Forrest Guo | MSDN Community Support | Feedback to manager

    Monday, August 27, 2012 2:42 AM
  • Hi Forrest,

    Thanks for the quick reply. This is the first time I've shared anything on SkyDrive, so hopefully I did it correctly.!139&authkey=!ABWszbJKsNoESEE

    I was able to reproduce the issue in this project. I created three independent projects. Common, SharePoint1, and SharePoint2. I referenced Common from both SharePoint1 and SharePoint2. I then referenced SharePoint1 from SharePoint2. I suspected that would cause the issue. It did not. I then went into the "Package" for SharePoint2 and on the "Advanced" tab, I added the additional assemblies, Common and SharePoint1. This was required in Visual Studio 2010 as it would not deploy dependent assemblies when you pressed F5. I suspect I could have created two projects (SharePoint1 and Common) and result in the same issue by simply add the "Additional Assemblies" in the package.

    I will do further experimentation. Maybe it is not required in 2012 and this is a "no issue", but still a "need to know about" situation.

    Monday, August 27, 2012 10:22 PM
  • I experimented a bit with this. As I mentioned previously, it breaks when adding the referenced assemblies as "Additional Assemblies" to deploy to the GAC. Removing the additional assemblies in 2012 fixes the issue. However, neither of those assemblies get deployed. I have to assume they are embedded?

    By the way, to clarify, I am deploying the project "SharePoint2".

    Monday, August 27, 2012 10:37 PM
  • So, after much experimentation, deliberation, and finally victory, I feel silly. So, for the original project (in 2012), I removed the Additional Assemblies in the "dependent" SharePoint Project and just updated the deployment order. In essence, before F5 deploying the dependent project, I must right-click deploy the project it depends on.

    Project A depends on Project B.

    1. Right-click deploy Project B
    2. F5 deploy Project A
    3. Watch the fireworks

    Thanks for your time Forrest. For whatever reason, VS 2010 was just more forgiving I guess.

    Monday, August 27, 2012 10:52 PM