Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Tuesday, June 17, 2014

Visual Studio 2013 bug with SharePoint 2010

We are using Über-packages with SharePoint that stopped working after we upgraded from Visual Studio 2010 to 2013.
The bug and workaround are described here

Description:
In VS2010 I can package the SharePoint 2010 projects without a problem. 
When I open the same code in VS2013 I can compile without any compilation errors
However when I am trying to "publish" I am getting compilation errors.
This is related to the "additional assemblies" that are project outputs. If I change to hard-coded path this fixes the problem. Unfortunately that is not acceptable because we have multiple configurations.

Workaround:
1. Open C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets
2. Find the following line and remove the @(ProjectOutputReference)
    <UnfilteredSharePointProjectDependency Include="@(ProjectItemReference);@(FeatureReference);@(ProjectOutputReference)" Condition="%(FullPath) != '$(MSBuildProjectFullPath)'" />
3. Reload the project and it should publish fine now.

Apparently it did not help me with the production code, so I ended up editing csproj file and manually forcing version 10 of the build tools: