Skip to content

Slngen fails after specifying sdk section in global.json #229

@ninzavivek

Description

@ninzavivek
<style> </style>

We recently modified our global.json (repo root) as follows (highlighted, sdk version) to enforce devs and builds to use same version of .net core.

 

old new
{   "msbuild-sdks": {     "Microsoft.Build.CentralPackageVersions": "2.0.79",     "Microsoft.Build.NoTargets": "2.0.1",     "Microsoft.Build.Traversal": "3.0.2"   }, } {   "msbuild-sdks": {     "Microsoft.Build.CentralPackageVersions": "2.0.79",     "Microsoft.Build.NoTargets": "2.0.1",     "Microsoft.Build.Traversal": "3.0.2"   },   "sdk": {     "version":  "3.1.410",     "rollForward": "disable"   } }

 

Issue: slngen has stopped working. It seems it is looking for NET.SDK version , which it can find.

 

Build seems to work, and also seems happen to be on newer version [SlnGen version 5.0.5+a35108ec43 for .NET Core] . I have a machine with [SlnGen version 4.5.0+0f3e272a24 for .NET Framework] and that seems to work.

 

I also investigated following link: https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2019

 

C:\Users\vivekagg\.nuget\packages\microsoft.build.traversal\3.0.2\Sdk\Sdk.props(15,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildSdkResolver" failed to run. Method not found: 'Microsoft.Build.Framework.SdkResult Microsoft.Build.Framework.SdkResultFactory.IndicateSuccess(System.String, System.String, System.Collections.Generic.IDictionary`2<System.String,System.String>, System.Collections.Generic.IDictionary`2<System.String,Microsoft.Build.Framework.SdkResultItem>, System.Collections.Generic.IEnumerable`1<System.String>)'.

MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

 

Unfortunately, MSDN link for global.json doesn’t provide much info about its schema either : https://docs.microsoft.com/en-us/dotnet/core/tools/global-json?tabs=netcore3x

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions