Monday 11 May 2015

The "TransformFiles" task was not given a value for the required parameter "IsDebugging"

Good Morning Friends! :)

Hope you all must be doing good!

I am going to write today about one issue which sometimes occur when you try to upgrade your SharePoint Project from Visual Studio 2010 to Visual Studio 2013.

It can also occur in any new SharePoint Project in Visual Studio 2013 directly if you try to add "PostBuildEventDependsOn" property in .csproj/.vbproj file(from notepad) to generate the .wsp at the time of building the project.

Exception you get is:
The "TransformFiles" task was not given a value for the required parameter "IsDebugging"


When you add the same properties to .csproj/.vbproj file (from notepad) in Visual Studio 2010 SharePoint project then it works well and creates the .wsp correctly there. Notice the "\v10.0\" in the project path for VS 2010.

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />
  <PropertyGroup>      
                 <PostBuildEventDependsOn>$(PostBuildEventDependsOn);CreatePackage</PostBuildEventDependsOn>
<PostBuildEvent>copy "$(TargetDir)$(TargetName).wsp" "$(SolutionDir)DeploymentFiles\$(TargetName).wsp"</PostBuildEvent>

  </PropertyGroup>



But when you try to use the same settings in Visual Studio 2013 project then it doesn't work and throws the excpetion The "TransformFiles" task was not given a value for the required parameter "IsDebugging".

Notice the "\v12.0\" in the project path for VS 2013.

  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />
  <PropertyGroup>    <PostBuildEventDependsOn>$(PostBuildEventDependsOn);CreatePackage</PostBuildEventDependsOn>
<PostBuildEvent>copy "$(TargetDir)$(TargetName).wsp" "$(SolutionDir)DeploymentFiles\$(TargetName).wsp"</PostBuildEvent>
  </PropertyGroup>


Exception says that property "IsDebugging" which is a required property is not provided with any value.

After carefully examining the "Microsoft.VisualStudio.SharePoint.targets" file, it was observed that this property "IsDebugging" is being used inside "TransformFiles" element.

After googling a lot for this exception, haven't found any resolution.

While troubleshooting, I just provided value for "IsDebugging" like below and Voila! It worked! There was no more exception after building the solution and .wsp was generated perfectly.

  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />
  <PropertyGroup>
<IsDebugging>False</IsDebugging>    <PostBuildEventDependsOn>$(PostBuildEventDependsOn);CreatePackage</PostBuildEventDependsOn>
<PostBuildEvent>copy "$(TargetDir)$(TargetName).wsp" "$(SolutionDir)DeploymentFiles\$(TargetName).wsp"</PostBuildEvent>
  </PropertyGroup>

Please note one important thing here, I had to use PostBuildEvent command to copy .wsp to some another location. When I wasnot using this command, .wsp file was not getting build at bin\release folder.

Hope it will help someone out there to save his/her day.

Happy Learning! :)