Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error APPX3212: SDK root folder for 'Portable 7.0' cannot be located

I'm trying to build my solution using TeamCity / MSBuild. It's a WebAPI project which shares some entities in a PCL with a mobile client.

I see there are a few caveats around getting the PCL reference libraries installed on a buildserver, which I think I've sorted (Building Portable Class Library Project in build server fails)

However, I'm getting an error during the build of the portable class library as follows:

[11:20:49][Doctrina.Pcl.Entities\Doctrina.Pcl.Entities.csproj] _GetSdkToolPaths [11:20:49][_GetSdkToolPaths] GetSdkPropertyValue *[11:20:49][GetSdkPropertyValue] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(975, 5): error APPX3212: SDK root folder for 'Portable 7.0' cannot be located. See http://go.microsoft.com/fwlink/?prd=12560&pver=1.0&plcid=0x409&ar=MSDN&sar=PlatformMultiTargeting&o1=Portable&o2=7.0 for more information.*

The "help" link doesn't go anywhere useful and it seems to be very google-resistant in terms of finding any resolution.

I don't have Visual Studio 2015 installed on the build-server at all, but I have installed PortableClassLibrary tools, copied the reference directory from my local PC over, etc, as per the other related SO question.

Help please?

like image 577
Dave R Avatar asked Jul 22 '16 11:07

Dave R


1 Answers

I encountered this error when attempting to build portable projects targeting .NET Standard.

I managed to resolve it without installing Visual Studio on my build server, by copying from a machine that does have Visual Studio installed:

  • C:\Program Files (x86)\Microsoft SDKs\Portable\v14.0
  • C:\Program Files (x86)\MSBuild\Microsoft\Portable
  • C:\Program Files (x86)\ReferenceAssemblies\Microsoft\Framework.NETPortable

I later attempted to build a WebApi project targeting .NET Core (this was an xproj file) and as soon as I added the XProj file to my solution, I had to also copy:

  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet
  • C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet.Web

That got me a bit further but it also caused other projects to stop building properly (that were working fine without the XProj file in the solution). One thing I noticed, the NuGet tooling for .NET Core does not support authenticated NuGet feeds, so I had to enable anonymous access on my feed. But now my .NET Standard project now fails with error MSB4057: The target "_GenerateDependencyFragmentJson" does not exist in the project.

I've yet to get around to diagnosing this, but I hope the above information helps someone. If you're not using xproj files and just trying to use .NET Standard projects, the above should be all you need to build without installing Visual Studio.

Just a side note, I tried really hard to avoid having to copy these files by first trying to install Microsoft Build Tools 2015 Update 3, hoping it would put the required files in place, but it did not sadly. I'm pinning my hopes on the next version of MSBuild that is being used in VS15, and hoping that it's build tools package will have everything required to build this stuff when it comes out, as it doesn't seem like they are updating the 2015 Build Tools with this support.

like image 67
Sam Nelson Avatar answered Oct 11 '22 17:10

Sam Nelson