Friday, August 14, 2015

How to TransformFiles error when upgrade SharePoint Project from Visual Studio 2010 to Visual Studio 2013



Today, let me explain you about How to TransformFiles error when upgrade SharePoint Project from Visual Studio 2010 to Visual Studio 2013. It may occur in any new SharePoint Project in Visual Studio 2013 directly if you are attempting to add the “PostBuildEventDependsOn” property in a .csproj/.vbproj file (from a text editor like Notepad) to get the .wsp once building the project. And I got the exception: The “TransformFiles” task was not given a value for the required parameter “IsDebugging”
When you add identical properties to a .csproj/.vbproj file (from a text editor like Notepad) in Visual Studio 2010 SharePoint project then it works well and creates the .wsp properly there. Notice the “\v10.0\” within the project path for Visual Studio 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 once you attempt to use a similar settings within the Visual Studio 2013 project then it does not work and throws the exception The “TransformFiles” task wasn’t given a value for the desired parameter “IsDebugging”.
Notice the “\v12.0\” in the project path for Visual Studio 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>
The exception says that the property “IsDebugging” that’s a needed property isn’t provided with any value. After carefully examining the “Microsoft.VisualStudio.SharePoint.targets” file, it absolutely was observed that this property “IsDebugging” is being used inside the “TransformFiles” component. After doing very much Googling for this exception, i have never found any answer. While troubleshooting, I simply provided the value for “IsDebugging” as within the following and Voila! It worked! There was no a lot of exception when building the solution and also the .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 necessary thing here, i want to use the PostBuildEvent command to copy the .wsp to another location. once I wasn’t using this command, the .wsp file wasn’t being built at the bin\release folder.

No comments:

Post a Comment