I get this error in the deployment step of a share-point farm based project. Most of the suggested solutions on the net are a simple Visual Studio re-start, however, a simple VS restart won't fix this.

Any ideas on what might be causing this?

  • I just unloaded and reloaded project then it worked. Commented May 27, 2014 at 16:33

5 Answers 5


I had the same problem today. I compared the project files with an older version. In my case the Package directory (with the files Package.package and Package.Template.xml) was missing.

After copying this directory back from the older version of the project and modifying the csproj file to include the references to the package directory, the error solved and the solution can be deployed again.

I added the following settings to the csproj file to restore the binding to the package directory.

    <None Include="Package\Package.package">
    <None Include="Package\Package.Template.xml">

Something similar could be the problem in your situation.

  • Exactly what happened to me. In my case I opened the same Visual Studio solution on another SharePoint server, did a Get Latest through TFS but the package was missing from the project. I had to "Get Specific Version" and overwrite all files to get the correct .csproj through.
    – Jay
    Commented Nov 28, 2013 at 11:37
  • Same thing happened with me. I did not have to add the mentioned lines to the csproj file though. I simply had to close and re-open the solution. I was using tfs when this happened like @Jay mentioned.
    – LukeP
    Commented Jan 21, 2014 at 19:40
  • +1 & answer ; Wow this would have been very helpful then :/ this was such a pain
    – anpatel
    Commented Oct 30, 2014 at 1:00
  • Thanks, it has solved the problem also in my situation. Btw it was caused by TFS and using more virtual machines and sharing one TFS workspace between them. VS didn't download Package folder from TFS, so Visual studio removed this config from csproj. So after creation of new TFS workspace and redownload source, Package folder was downloaded (Force getLastVersion and overwite existing files also helps...). Commented Apr 1, 2019 at 11:10

A few suggestions:

  • Make sure your solution builds (without deployment) without errors. F6

  • If not, check that your solution is set to build on Any CPU

  • If not, check that you don't have logical programming errors in your solution

When the solution builds:

  • Check your pre- and post- deployment steps ALT + ENTER

  • Still doesn't work? Validate your solution deployment URL

  • Still doesn't work? Uninstall and remove your solution from the farm using Uninstall-SPSolution and Remove-SPSolution cmdlet. Make sure all of your features are gone from the farm with Get-SPFeature cmdlet

  • It didnt work after all of the above. I ended up just creating a new project and duplicating the web parts :/
    – anpatel
    Commented Jul 13, 2013 at 17:09

The other scenarios are explained here: http://praveenbattula.blogspot.in/2013/07/error-occurred-in-deployment-step.html


Before Sorry for my english. If you insert only this code in csproj file manualy , always after is overrided with currently files package in you project (but this is your problem, package folder not found) , you must add or create package to your project and then , in csproj file automaticaly writed new package guid in tag xml

But thanks for the precious direction


In my case it solved by adding the setting for hosts file like mysite.domain.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.