12

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. – Brandon Harris May 27 '14 at 16:33
15

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.

<ItemGroup>
...
    <None Include="Package\Package.package">
      <PackageId>{03851424-152b-45c0-80c9-ac18975dc663}</PackageId>
    </None>
    <None Include="Package\Package.Template.xml">
      <DependentUpon>Package.package</DependentUpon>
    </None>
...
</ItemGroup>

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 Nov 28 '13 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 Jan 21 '14 at 19:40
  • +1 & answer ; Wow this would have been very helpful then :/ this was such a pain – anpatel Oct 30 '14 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...). – Petr Špaček Apr 1 at 11:10
2

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 Jul 13 '13 at 17:09
0

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

0

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

-2

In my case it solved by adding the setting for hosts file like

127.0.0.1 mysite.domain.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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