Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
GitHub or 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.
Created attachment 25610 [details]
If .NET Core 2.0 is not installed it's not possible to compile .NET Standard 2.0 project.
See attached sample and try to compile with `msbuild`. It will fail because `Assembly` property is not part of `System.Type`, which is not true for 2.0, reason for this is that building falls back to .NET Standard 1.6.1 this can be seen in msbuild output(it's referencing 1.6.1 assembles and in obj/project.assets.json it shows that 1.6.1 is used and not 2.0.
When I tried this on Windows with just .NET Core 1 SDK installed it had the same problem. It seems that the .NET Core 1.1 sdk does not indicate an error if an unsupported .NET Standard version is used with it and it just silently downgrades the .NET Standard Library package reference which may or may not be caught by the code that is used.
I also am not sure if we should be shipping .NET Core 2.0 sdk with Mono since MSBuild will now resolve it if it is installed. This was not the case with .NET Core 1.1 sdk so it is shipped with Mono.
Ideally I think the .NET Core 1.1 sdk would indicate an error if an unknown/unsupported version of .NET Standard is being used in the project.
Could you report this netstandard/netcore on issues tracker?
I still think Mono should support .NET Standard 2.0 without installing .NET Core.
This seems to already be handled by .NET Core 1.1.4 SDK. If you run `dotnet restore` on a .NET Standard 2.0 sdk project with only .NET Core SDK 1.1.4 installed you seen an error:
/usr/local/share/dotnet/sdk/1.1.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.TargetFrameworkInference.targets(126,5): error : The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0. [~/Projects/Tests/dotnet/dotnet.csproj]