Bug 60995 - The expression Microsoft.Build.Utilities.ToolLocationHelper.GetPathToStandardLibraries
Summary: The expression Microsoft.Build.Utilities.ToolLocationHelper.GetPathToStandard...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Templates ()
Version: unspecified
Hardware: PC Windows
: Highest critical
Target Milestone: 15.6
Assignee: Ankit Jain
: 61098 ()
Depends on:
Reported: 2017-12-06 06:21 UTC by Pierce Boggan [MSFT]
Modified: 2018-01-08 06:37 UTC (History)
10 users (show)

Is this bug a regression?: ---
Last known good build:

IDE Logs (46.89 KB, application/x-zip-compressed)
2017-12-06 06:21 UTC, Pierce Boggan [MSFT]
Exception Dialog (168.31 KB, image/png)
2017-12-06 06:23 UTC, Pierce Boggan [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Pierce Boggan [MSFT] 2017-12-06 06:21:56 UTC
Created attachment 25919 [details]
IDE Logs

# Steps to Reproduce

1. Pull down Visual Studio 2017 version 15.6 (aka.ms/vs/dogfood/install)
2. Install the latest Visual Studio Tools for Xamarin + Xamarin.Android d15-6 builds.
3. File -> New Project -> Cross-Platform -> Cross-Platform App (and/or Mobile App)
4. Click OK.

# Expected Result
Template unfolds successfully.

# Actual Result
Template cannot unfold due to MSBuild pop-up:

# Additional Information
ActivityLog.xml attached.
Xamarin logs attached.

# Environment Info
Microsoft Visual Studio Enterprise 2017 Int Preview
Version 15.6.0 Preview 1.0 [27204.1.d15.6]
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Visual F# 4.1   00369-60000-00001-AA695
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.10.01106.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.31128.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2017   5.2.51127.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.31121.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

C# Tools   2.6.0-beta3-62405-04. Commit Hash: 0a5a4a32e36443b25587a2520d6349350247e141
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node   2.2.9000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.2.9000.1
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   1.8
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.2.9000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.51120.3

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.8.4-pre (3fe64e3)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Snapshot Debugging Extension   1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools   15.1.61710.120
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   15.5.11025.1
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   2.6.0-beta3-62405-04. Commit Hash: 0a5a4a32e36443b25587a2520d6349350247e141
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Universal Windows Apps   15.0.27204.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

WebJobs Tools v1.0.0   15.0.31121.0
WebJobs Tools v1.0.0

Xamarin (4a1f0ea)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   4.8.182 (76aa1723e)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK (HEAD/9cfa7836b)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK (c4240f3)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Pierce Boggan [MSFT] 2017-12-06 06:23:34 UTC
Created attachment 25920 [details]
Exception Dialog
Comment 3 Pierce Boggan [MSFT] 2017-12-12 04:19:07 UTC
We have customers reproducing this as well on 15.6 Preview 1.
Comment 4 Jon Douglas [MSFT] 2017-12-12 23:16:33 UTC
This looks like a potential issue with <FrameworkPathOverride> and what we pass into MSBuild?




I am marking this issue as CONFIRMED as I can reproduce on 15.6 Preview 2 on Android and not iOS.
Comment 5 Pierce Boggan [MSFT] 2017-12-13 18:37:02 UTC
Another customer is now hitting this issue:
Comment 6 Pierce Boggan [MSFT] 2017-12-13 19:15:22 UTC
Duplicate from QA:
Comment 7 Jon Douglas [MSFT] 2017-12-13 19:23:43 UTC
Setting status to HIGHEST - CRITICAL and target milestone to 15.6 for bugzilla visibility on a Xamarin.Android template blocking issue in 15.6. 

Context: 15.6 introduces new templates using https://github.com/dotnet/templating and currently Xamarin.Android fails to unfold these templates with the error given in https://bugzilla.xamarin.com/show_bug.cgi?id=60995#c0

https://github.com/xamarin/xamarin-templates (For the Forms templates that are currently failing)

We would need a fix for this prior to 15.6 RTW to ship these templates.
Comment 8 Jonathan Pryor 2017-12-13 21:15:53 UTC
One point of confusion: Attachment #25920 [details] says:

> The expression
> '[Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries(MonoAndroid, "v7.1", '', '', '')"
> cannot be evaluated. Input string was not in a correct format.
> C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets

I believe that the dialog contains the path to the file triggering the error message:

> C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets

That's...not ours.

Furthermore, neither the xamarin-android nor monodroid project git repo's contain the string 'GetPathToStandardLibraries':

$ git grep GetPathToStandardLibraries
# no output

Additionally, Xamarin.Android is what is in the *stable* channel. (The Xamarin.Android team has not yet updated anything for d15-6; we plan on landing for d15-6 P2.)

This in turn means that d15-6 "something" (MSBuild?) is incompatible with d15-5 Xamarin.Android. I'm not sure what my team is supposed to do here.
Comment 9 Jonathan Pryor 2017-12-13 21:16:11 UTC
Ankit: Help? :-D
Comment 10 Jonathan Peppers 2017-12-13 21:21:35 UTC
For what it's worth, I don't think `Microsoft.Common.CurrentVersion.targets` is the culprit either.

Looking at:

It seems the line is the same as it was in msbuild/15.5:
Comment 11 Pierce Boggan [MSFT] 2017-12-14 21:47:36 UTC
*** Bug 61098 has been marked as a duplicate of this bug. ***
Comment 12 stephen.machwirth 2017-12-15 10:58:33 UTC
Apparently when the template is generated it'll add the following line in the android csproj file:
The solution then is to change it to:
Without the quotes and after that, everything works fine again!
Comment 13 Jimmy [MSFT] 2017-12-15 17:52:48 UTC
Issue was due to a change in the dotnet templating engine https://github.com/xamarin/xamarin-templates/commit/afa79360489f0f92f43d5f5d475830de231fbbf0
Comment 14 Gaurav Ganorkar 2018-01-08 06:37:41 UTC
This issue is FIXED on the Xamarin.Template v 1.0.51. 

I am now able to create Crossplatform project without any error 

Screencast link-

Build info-
Microsoft Visual Studio Enterprise 2017 d15.6stg
Version 15.6.0 Preview 3.0 [27229.3003.d15.6stg]
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Enterprise

Xamarin (d41207be8)
Xamarin Designer   4.8.188 (c5813fa34)
Xamarin.Android SDK (HEAD/1e47e7ed5)
Xamarin.iOS and Xamarin.Mac SDK (d15aa28)
Xamarin.Template 1.0.51

Full build info-https://gist.github.com/ganorkargaurav/cfbd4417c099a2444149c2a6a5c08f4e

Note - FIX verified on Xamarin.Template version 1.0.51