14

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?

Community
  • 1
  • 1
Dave R
  • 1,626
  • 19
  • 28
  • OK. I resolved this error by installing "VS2015 Community Edition" on my build server, so there is clearly something Xamarin-y that is part of VS install, but isn't installed by the PCL tools. Anyone know what it is? – Dave R Jul 25 '16 at 10:23
  • 1
    installing VS2015 CE sounds so extreme. I am experiencing the same issue at the moment. Wish there was someone that managed. - Added a bounty... maybe this will get some attention now :) – stoic Oct 11 '16 at 13:33
  • Have you checked out this answer - http://stackoverflow.com/a/19385710/1824367 I had a similar problem & ended up solving it with a similar solution. – mattferderer Oct 17 '16 at 15:49

1 Answers1

4

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.

Sam Nelson
  • 387
  • 1
  • 11
  • I'm running into the same 'MSB4057: The target "_GenerateDependencyFragmentJson" does not exist in the project.' Did you actually manage to diagnose this? So far the only solution I've seen online but have not tested yet is actually installing VS2015 on the build server... Something i'd much rather avoid. – F.B. ten Kate Dec 02 '16 at 07:07
  • Unfortunately I haven't had time to further diagnose this problem. I'm sure there will be a way to avoid installing VS2015 on the server, but it requires going through the MSBuild targets with a fine-toothed comb to find out that it's referencing that isn't present on the build server and needs to be manually copied there. That's how I find the stuff I mentioned in my answer. – Sam Nelson Dec 05 '16 at 11:51