How to: Open SharePoint page in edit mode

Scenario:
Open the page in edit mode by adding some query string parameters to the url

Simply append the following to the URL:

?ToolPaneView=2&pagemode=edit

Your url:
http://site:port/web/page.aspx

... will become:
http://site:port/web/page.aspx?ToolPaneView=2&pagemode=edit

The page will open in edit mode with the "Add Web Parts" web part visible.

FIX: Deployment was not performed for this project because it is a dependent project

Scenario:
Trying to deploy multiple SharePoint solutions from Visual Studio you are getting the following error:
Deployment was not performed for this project because it is a dependent project

You probably have a helper/utility project defined SharePoint project but with an empty package:




Fix:
Open the Configuration Manager (right click on the solution file in Solution Explorer and select Configuration Manager ...)
Clear the Deploy checkbox for your project.

FIX: Error MSB4018: The "ValidatePackage" task failed unexpectedly. The project service does not contain the specified project.

Scenario:
Your SharePoint solution build fails with this error:
The "ValidatePackage" task failed unexpectedly.
The project service does not contain the specified project.
and the GUID provided is the ID of the project you are trying to build

Build log:

...

  CopyFilesToOutputDirectory:
  Copying file from "obj\Debug\Helpers.dll" to "D:\Builds\Binaries\Helpers.dll".
  Helpers -> D:\Builds\Binaries\Helpers.dll
  Copying file from "obj\Debug\Helpers.pdb" to "D:\Builds\Binaries\Helpers.pdb".
(...): error MSB4018: The "ValidatePackage" task failed unexpectedly. [D:\Builds\SPTest\Helpers\Helpers.csproj]
(...): error MSB4018: System.InvalidOperationException: The project service does not contain the specified project: 618318f6-eff6-4fa9-9b39-3a9a6febb01b. [D:\Builds\SPTest\Helpers\Helpers.csproj]
(...): error MSB4018:    at Microsoft.VisualStudio.SharePoint.Tasks.ValidatePackage.OnCheckParameters() [D:\Builds\SPTest\Helpers\Helpers.csproj]
(...): error MSB4018:    at Microsoft.VisualStudio.SharePoint.Tasks.BuildTask.Execute() [D:\Builds\SPTest\Helpers\Helpers.csproj]
(...): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\Builds\SPTest\Helpers\Helpers.csproj]
(...): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() [D:\Builds\SPTest\Helpers\Helpers.csproj]
Done Building Project "D:\Builds\SPTest\Helpers\Helpers.csproj" (default targets) -- FAILED.

...

Fix C#:
Open the *.csproj in a text editor.
look for the <ProjectTypeGuids> entry and make sure the following guids are listed there:
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    ...
    <ProjectTypeGuids>{BB1F664B-9266-4fd6-B973-E1E44974B511};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    ...
  </PropertyGroup>
  ...
</Project>

Fix VB.NET:
Open the *.vbproj in a text editor.
look for the <ProjectTypeGuids> entry and make sure the following guids are listed there:
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    ...
    <ProjectTypeGuids>{BB1F664B-9266-4fd6-B973-E1E44974B511};{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
    ...
  </PropertyGroup>
  ...
</Project>
Note:
The above guids identify these project types:

{BB1F664B-9266-4fd6-B973-E1E44974B511} – SharePoint 2011 project
{C1CDDADD-2546-481F-9697-4EA41081F2FC} – SharePoint 2013 project
{14822709-B5A1-4724-98CA-57A101D1B079} – Workflow C# project
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} – C# project
{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8} - Workflow VB.NET project
{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - VB.NET project

FIX: Error occurred in deployment step 'Recycle IIS Application Pool': Exception has been thrown by the target of an invocation.

Scenario:
Trying to deploy a SharePoint 2010 solution from Visual Studio 2012 you get this error:
Error occurred in deployment step 'Recycle IIS Application Pool': Exception has been thrown by the target of an invocation.

Output:

------ Deploy started: Project: Helpers, Configuration: Debug Any CPU ------
Deployment was not performed for this project because it is a dependent project.
------ Deploy started: Project: SiteColumns, Configuration: Debug Any CPU ------
Active Deployment Configuration: No Activation
Run Pre-Deployment Command:
  Skipping deployment step because a pre-deployment command is not specified.
Recycle IIS Application Pool:
Error occurred in deployment step 'Recycle IIS Application Pool': Exception has been thrown by the target of an invocation.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 1 failed, 0 skipped ==========

Background:
I am referencing some DLL files located in the "..\..\Binaries\Sharepoint" custom folder (this section in the *.csproj was generated by Visual Studio when I added references through the UI):
  <ItemGroup>
    <Reference Include="Microsoft.SharePoint.Linq, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
      <HintPath>..\..\Binaries\SharePoint\Microsoft.SharePoint.Linq.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
      <HintPath>..\..\Binaries\SharePoint\Microsoft.SharePoint.Publishing.dll</HintPath>
    </Reference>
    ...
  </ItemGroup>

Fix:
I removed the highlighted parts of the *.csproj above (version, culture, public key token and processor architecture), ending up with this:
  <ItemGroup>
    <Reference Include="Microsoft.SharePoint.Linq">
      <HintPath>..\..\Binaries\SharePoint\Microsoft.SharePoint.Linq.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.SharePoint.Publishing">
      <HintPath>..\..\Binaries\SharePoint\Microsoft.SharePoint.Publishing.dll</HintPath>
    </Reference>
    ...
  </ItemGroup>