JamesNK / Newtonsoft.Json

Json.NET is a popular high-performance JSON framework for .NET
https://www.newtonsoft.com/json
MIT License
10.79k stars 3.26k forks source link

compilation errors on building the Newtonsoft.Json.sln #2195

Open issawigga opened 5 years ago

issawigga commented 5 years ago

I'm having Visual Studio 2017 on Win 10. I'm trying to compile the latest Newtonsoft.Json-master.zip project (Newtonsoft.Json.sln) and i'm getting these following errors mentioned below:

1>------ Build started: Project: Newtonsoft.Json, Configuration: Debug Any CPU ------ 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\net35\Newtonsoft.Json.dll 1>Done building project "Newtonsoft.Json.csproj". 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\net45\Newtonsoft.Json.dll 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\net40\Newtonsoft.Json.dll 1>Done building project "Newtonsoft.Json.csproj". 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\net20\Newtonsoft.Json.dll 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\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. 1>Done building project "Newtonsoft.Json.csproj" -- FAILED. 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>C:\Users\biksingh.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json'. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>C:\Users\biksingh.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19367-01\build\Microsoft.SourceLink.Common.targets(50,5): warning : Source control information is not available - the generated source link is empty. 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\netstandard1.0\Newtonsoft.Json.dll 1>Done building project "Newtonsoft.Json.csproj". 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\portable-net40+win8+wpa81+wp8+sl5\Newtonsoft.Json.dll 1>Done building project "Newtonsoft.Json.csproj". 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\netstandard1.3\Newtonsoft.Json.dll 1>Newtonsoft.Json -> D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json\bin\Debug\portable-net45+win8+wpa81+wp8\Newtonsoft.Json.dll 2>------ Build started: Project: Newtonsoft.Json.Tests, Configuration: Debug Any CPU ------ 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets(112,5): error : The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 2>CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets(112,5): error : The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 2>CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets(112,5): error : The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.1. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 2>CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 2>CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 2>CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 2>CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED. 3>------ Build started: Project: Newtonsoft.Json.TestConsole, Configuration: Debug Any CPU ------ 3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets(112,5): error : The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. 3>Done building project "Newtonsoft.Json.TestConsole.csproj" -- FAILED. 3>CSC : error CS0006: Metadata file 'D:\CEF\NewtonSoft\Newtonsoft.Json\Src\Newtonsoft.Json.Tests\bin\Debug\net46\Newtonsoft.Json.Tests.dll' could not be found 3>Done building project "Newtonsoft.Json.TestConsole.csproj" -- FAILED. ========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

I could fine the files Newtonsoft.Json.dll \bin\Debug\net45 folder which i assume should be used but I'm not able to get any output for Newtonsoft.Json.Tests & Newtonsoft.Json.TestConsole projects for the testing purpose.

bartelink commented 5 years ago

error : The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. 2>Done building project "Newtonsoft.Json.Tests.csproj" -- FAILED.

Seems you don't have the right SDK etc (there's also an error about needing C# langver 8.0). Worth using the command line build to snuff out these things - ultimately the issues list here is for when select is broken - day to day problems like this are better approached on StackOverflow - you'll get a quicker answer and the world will get better searchability.