Bug 57276 - Update .NET Core SDKs shipped with MSBuild to 1.0.4
Summary: Update .NET Core SDKs shipped with MSBuild to 1.0.4
Status: VERIFIED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: msbuild ()
Version: 5.2 (2017-04)
Hardware: PC Mac OS
: Normal normal
Target Milestone: 15.4
Assignee: Ankit Jain
URL:
Depends on:
Blocks:
 
Reported: 2017-06-08 15:32 UTC by Matt Ward
Modified: 2017-08-07 09:56 UTC (History)
4 users (show)

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


Attachments
.net Core 1.0.4 SDK Files (4.95 KB, application/x-zip-compressed)
2017-07-28 09:32 UTC, Mohak Barokar
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 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.

Related Links:
Status:
VERIFIED FIXED

Description Matt Ward 2017-06-08 15:32:55 UTC
Can we update all the SDKs that are shipped with Mono's MSBuild to the latest stable version which is currently 1.0.4?

Currently to get latest VS for Mac to successfully compile an ASP.NET Core project, when the .NET Core sdk not installed separately, requires the MSBuildSDKsPath to be configured:

https://github.com/mono/monodevelop/pull/2586#discussion_r120915186

The .NET Core 1.0.4 SDK does not use the MSBuildSDKsPath property when importing other files so this workaround could be removed when Mono updates the SDK files it uses.
Comment 1 Ankit Jain 2017-06-22 07:03:33 UTC
Do we know the nuget packages corresponding to the various SDKs or should these be picked up directly from `1.0.4` download?
Comment 2 Matt Ward 2017-06-22 08:17:42 UTC
I do not know the NuGet package versions. A quick look at the dotnet.myget.org/feed/dotnet-core/ package feed and whilst possibly there is a .nupkg available for Microsoft.NET.Sdk 1.0.4, there are no recent .nupkg files for Microsoft.NET.Sdk.Web, the last is October 2016, so I would just take the files that are shipped with the .NET Core 1.0.4 SDK.
Comment 4 Sumanta Welekar 2017-07-18 13:37:13 UTC
I have verified bug on

Build link :
https://github.com/xamarin/release-manifests/blob/d15-3/d15-3/2017-07-14_204051-15.3preview5.json

and it's working fine as expected.

Build Info : VisualStudioForMac-Preview-7.1.0.1289

Detail build info : https://gist.github.com/ganorkargaurav/2ab337833459530df2e4b597e29b28a6
Comment 5 Matt Ward 2017-07-18 13:41:10 UTC
@Sumanta - What were the verification steps?
Comment 6 Sumanta Welekar 2017-07-18 13:49:44 UTC
@matt 

I have machine on which .net is not present.

then I just installed the latest mono from here :

https://bosstoragemirror.azureedge.net/wrench/mono-2017-04/ef/ef39d08daf20a7e6291f73504b5bebe46366ba06/MonoFramework-MDK-5.2.0.213.macos10.xamarin.universal.pkg

after installing it shows following version of .net sdk's

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.0-preview1-002111-00
	1.1.2
	1.1.1
	1.0.5
	1.0.4
SDK: /usr/local/share/dotnet/sdk/2.0.0-preview1-005977/Sdks
SDK Versions:
	2.0.0-preview1-005977
	1.1.1-preview2-003177
	1.0.4
	1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks
Comment 7 Matt Ward 2017-07-18 13:56:40 UTC
The information in the about dialog does not shows the .NET Core sdks installed with Mono. It shows the .NET Core sdks installed using the .NET Core installers. The only information about Mono's SDKs is the MSBuild SDKs path. The information in the about dialog does not indicate that Mono includes the .NET Core 1.0.4 sdk.
Comment 8 Sumanta Welekar 2017-07-18 14:00:35 UTC
@matt

then what exact step I have to follow to reproduce this?
Comment 9 Matt Ward 2017-07-18 14:06:35 UTC
@Sumanta - That is what I was just trying to work out :)

There is not really anything I can see in the files that indicates that version 1.0.4 of the sdk is installed. Unless Ankit knows of anything.

Looking at the changes to the files you could check:

1) Microsoft.NET.SupportedTargetFrameworks.props file should exist. It is a new file added.

/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.SupportedTargetFrameworks.props

2) Check that the following Microsoft.NET.Sdk.Web/Sdk/Sdk.props has a new style importl

/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Sdks/Microsoft.NET.Sdk.Web/Sdk/Sdk.props

New style import:

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />

3) Check the Microsoft.NET.Sdk.DefaultItems.targets defines two runtimes: 1.0.5 and 1.1.2.

/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.DefaultItems.targets

  <RuntimeFrameworkVersion Condition="'$(RuntimeFrameworkVersion)' == '' And '$(_TargetFrameworkVersionWithoutV)' == '1.0'">1.0.5</RuntimeFrameworkVersion>
     <RuntimeFrameworkVersion Condition="'$(RuntimeFrameworkVersion)' == '' And '$(_TargetFrameworkVersionWithoutV)' == '1.1'">1.1.2</RuntimeFrameworkVersion>


There may be a better way to verify this by running an MSBuild command. Not sure yet.
Comment 10 Matt Ward 2017-07-18 14:08:19 UTC
I also do not believe this fix will be available in Mono for 15.3. The target milestone probably needs updating to 15.4
Comment 14 Mohak Barokar 2017-07-28 09:32:18 UTC
Created attachment 23864 [details]
.net Core 1.0.4 SDK Files

This bug is verified on d15_4 Branch build having following config:

 -Visual Studio Community 2017 for Mac (Preview) Version 7.2 Preview (7.2 build 446)
 -Xamarin.iOS Version: 10.14.0.4 
 -Xamarin.Android Version: 7.5.0.2 
 -Xamarin.Mac Version: 3.8.0.4

 Detailed Build Config: https://gist.github.com/mohakbarokar/418919d3b553dfb691ded2ed16a6f4b4

Checkpoints verified:

1) Microsoft.NET.SupportedTargetFrameworks.props  exists. 

/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.SupportedTargetFrameworks.props

2) Check that the following Microsoft.NET.Sdk.Web/Sdk/Sdk.props has a new style import : It contains new style import as mentioned.

/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Sdks/Microsoft.NET.Sdk.Web/Sdk/Sdk.props

New style import:

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />

3) Check the Microsoft.NET.Sdk.DefaultItems.targets defines two runtimes: 1.0.5 and 1.1.2.  : Two runtimes are defined in mentioned file.

/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.DefaultItems.targets

  <RuntimeFrameworkVersion Condition="'$(RuntimeFrameworkVersion)' == '' And '$(_TargetFrameworkVersionWithoutV)' == '1.0'">1.0.5</RuntimeFrameworkVersion>
     <RuntimeFrameworkVersion Condition="'$(RuntimeFrameworkVersion)' == '' And '$(_TargetFrameworkVersionWithoutV)' == '1.1'">1.1.2</RuntimeFrameworkVersion>

 The bug is found to be fixed according to above checkpoints. 

@Matt I was unable to find msbuild command for verification. Please confirm if the above steps are proper or anything else need to be verified.

Attached Zip of above mentioned files.