Bug 58756 - Better warning when building netstandard projects without .NET core installed
Summary: Better warning when building netstandard projects without .NET core installed
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: .NET Core support ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: 15.4
Assignee: Matt Ward
URL:
Depends on:
Blocks:
 
Reported: 2017-08-14 20:56 UTC by Chris Hamons
Modified: 2017-08-17 12:16 UTC (History)
3 users (show)

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

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 or GitHub 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 Chris Hamons 2017-08-14 20:56:46 UTC
While testing https://bugzilla.xamarin.com/show_bug.cgi?id=58504 I attempted to reproduce _without_ .NET core installed.

I did not know I needed it, nor did the Xamarin stable installers install it.

I received for my trouble a bunch of errors like this:

/Users/donblas/Library/Caches/VisualStudio/7.0/MSBuild/78994_1/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.Common.targets(5,5): Error: Project '/Users/donblas/Projects/MySpecialConsoleProject/NetStandardLib/NetStandardLib.csproj' targets '.NETStandard,Version=v2.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.6.1'. (MySpecialConsoleProject)

which do not help me understand that I need to install a secondary item.

Once installing that, the things that should work started working.
Comment 1 Matt Ward 2017-08-14 21:05:15 UTC
Probably what should happen here is the same as what happens if you open a .NET Core 2.0 project when .NET Core 2.0 SDK is not installed. That will show a dialog saying you need to install the .NET Core 2.0 SDK and it will show an error for the project with a tooltip saying the same thing. So we just need to extend that logic to check for .NET Standard 2.0 and show the same dialog.

.NET Standard 1.x projects are supported by MSBuild that ships with Mono so there is no prompt for .NET Standard projects originally. I added support for the dialog for .NET Core 2.0 projects but not for .NET Standard 2.0 projects.

I will see if I can get this included in 15.4 otherwise it will have to be 15.5.
Comment 2 Matt Ward 2017-08-15 09:33:54 UTC
So what is discussed in Comment 1 is already implemented in VS Mac 7.2.0.487 but not in VS Mac 7.1.0.1294 (stable channel). You see a dialog saying that .NET Core 2.0 is not installed and an error icon next to the project in the Solution window.

VS Mac 7.1 has been closed to new features/bug fixes for a while so the only change made to VS Mac 7.1 recently was to allow support for .NET Core 2.0 final.