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

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


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


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:
Status:
VERIFIED FIXED

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:
https://www.screencast.com/t/7mE7jv9ps0

# 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]
VisualStudio.15.IntPreview/15.6.0-pre.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   4.8.0.752 (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   8.1.0.24 (HEAD/9cfa7836b)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   11.4.0.214 (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?

https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Xamarin.Android.Sdk.props#L24-L29

->

https://github.com/Microsoft/msbuild/blob/master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L83

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:
https://twitter.com/tonyvca/status/941009138221494272
Comment 6 Pierce Boggan [MSFT] 2017-12-13 19:15:22 UTC
Duplicate from QA:
https://devdiv.visualstudio.com/DevDiv/XamarinVS/_workitems/edit/536484
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 8.1.0.24 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:
https://github.com/Microsoft/msbuild/blob/master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L83

It seems the line is the same as it was in msbuild/15.5:
https://github.com/Microsoft/msbuild/blob/vs15.5/src/Tasks/Microsoft.Common.CurrentVersion.targets#L83
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
Workaround:
Apparently when the template is generated it'll add the following line in the android csproj file:
<TargetFrameworkVersion>"v8.0"</TargetFrameworkVersion>
The solution then is to change it to:
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
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-
http://www.screencast.com/t/Yg3jPh1M

Build info-
Microsoft Visual Studio Enterprise 2017 d15.6stg
Version 15.6.0 Preview 3.0 [27229.3003.d15.6stg]
VisualStudio.15.int.d15.6stg/15.6.0-pre.3.0+27229.3003.d15.6stg
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Enterprise

Xamarin   4.9.0.675 (d41207be8)
Xamarin Designer   4.8.188 (c5813fa34)
Xamarin.Android SDK   8.2.0.1 (HEAD/1e47e7ed5)
Xamarin.iOS and Xamarin.Mac SDK   11.8.0.0 (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