Cake build DotNet Core error - .net-core

I'm trying build my solution with dotnet core using cake but I receive it:
C:\Program Files\dotnet\sdk\1.0.1\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.Common.targets(73,5): error : Project 'xxx.csproj' targets '.NETCoreApp,Version=v1.1'. It cannot be referenced by a project that targets '.NETCoreApp,Version=v1.0'. [xxx.csproj]
What could be wrong?
If I run dotnet.exe build on cmd, the builds work normally
dotnet build xxx.csproj
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
CouchDB.Driver.Core -> xxx.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.50
Environment Machine
The xxx.csproj version is:
netcoreapp1.1
cake --version
Version 0.19.1+Branch.main.Sha.4c5b4fd5b1c4d9d36066ec78714027e26b211af4
dotnet.exe --version
1.0.1
dotnet.exe
Microsoft .NET Core Shared Framework Host
Version : 1.1.0
Build : 928f77c4bc3f49d892459992fb6e1d5542cb5e86

I forgot 2 things. The solution is:
Set correct framework in build.cake:
var settings = new DotNetCoreBuildSettings
{
Framework = "netcoreapp1.1",
Configuration = "Release",
OutputDirectory = "./build/"
};
DotNetCoreBuild("./src/", settings);
Restore NuGet packages using the DotNetCoreRestore instead nuget.exe
Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() => {
DotNetCoreRestore("src"); // use it instead of NuGetRestore("./folder");
});
The result is:
Build
Executing task: Build
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
CouchDB.Driver.Core -> xxx.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:11.10
Finished executing task: Build

Related

Chutzpah 4.4.11 failing with exit code 2 when running with vstest

vstest.console.exe 16.10 works with Chutzpah 4.2.3. But upgraded to Chutzpah 4.4.11, and it fails with exit code of 2. chutzpah.console.exe also works by itself in 4.4.11, so I'm not sure if I'm missing something in the vstest command line. (I get the same results with vstest.console.exe when running from an Azure DevOps pipeline.)
Any suggestions?
> "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
"[path-to-test-file]\index-tests.js"
/TestAdapterPath:"C:\Users\TFSBuild\.nuget\packages\chutzpah\4.4.11\tools"
Microsoft (R) Test Execution Command Line Tool Version 16.10.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Error: Unknown error occurred when executing test file. Received exit code of 2
While Running:[path-to-test-file]\index-tests.js
No test is available in [path-to-test-file]\index-tests.js.
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Test Run Failed.
Found the solution. I'm using Engine: Chrome, and the newer version of Chutzpah was failing to find chrome.exe. Defining the path to the exe in Chutzpah.json resolved the issue.
"Engine": "Chrome",
"EngineOptions": {
"ChromeBrowserPath": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
}

Azure Devops - dotnetcore build fails consistently - process failed to start

Am setting up a small project build, which is in .Net Core. dotnet build fails everytime with below log:
2019-10-03T21:31:54.5434435Z ##[section]Starting: dotnet build
2019-10-03T21:31:54.5559431Z ==============================================================================
2019-10-03T21:31:54.5559511Z Task : .NET Core
2019-10-03T21:31:54.5559544Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2019-10-03T21:31:54.5559595Z Version : 2.158.0
2019-10-03T21:31:54.5559626Z Author : Microsoft Corporation
2019-10-03T21:31:54.5559679Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2019-10-03T21:31:54.5559712Z ==============================================================================
2019-10-03T21:31:55.3428758Z [command]C:\windows\system32\chcp.com 65001
2019-10-03T21:31:55.3566253Z Active code page: 65001
2019-10-03T21:31:55.5334629Z [command]C:\hostedtoolcache\windows\dotnet\dotnet.exe build d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool.csproj --no-restore
2019-10-03T21:31:55.5534100Z ##[error]Error: There was an error when attempting to execute the process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe'. This may indicate the process failed to start. Error: spawn C:\hostedtoolcache\windows\dotnet\dotnet.exe ENOENT
2019-10-03T21:31:55.5546833Z ##[error]Dotnet command failed with non-zero exit code on the following projects : d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool.csproj
2019-10-03T21:31:55.5625878Z ##[section]Finishing: dotnet build
I have now added a dotnet SDK activity to load 2.2.x version and then then an explicit dotnet restore step (even though its not needed technically as build should do a restore too). But, the restore step passes, but it fails every time in the build step.
Some partial logs from the restore process are shown below -
2019-10-03T21:30:25.5826687Z ##[section]Starting: dotnet restore
2019-10-03T21:30:25.5942577Z ==============================================================================
2019-10-03T21:30:25.5942669Z Task : .NET Core
2019-10-03T21:30:25.5942702Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2019-10-03T21:30:25.5942756Z Version : 2.158.0
2019-10-03T21:30:25.5942787Z Author : Microsoft Corporation
2019-10-03T21:30:25.5942837Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2019-10-03T21:30:25.5942869Z ==============================================================================
2019-10-03T21:30:27.1500592Z [command]C:\windows\system32\chcp.com 65001
2019-10-03T21:30:27.7292436Z Active code page: 65001
2019-10-03T21:30:27.7296084Z SYSTEMVSSCONNECTION exists true
2019-10-03T21:30:28.0692275Z SYSTEMVSSCONNECTION exists true
2019-10-03T21:30:28.5211540Z SYSTEMVSSCONNECTION exists true
2019-10-03T21:30:28.5240738Z Saving NuGet.config to a temporary config file.
2019-10-03T21:30:28.5284543Z Saving NuGet.config to a temporary config file.
2019-10-03T21:30:28.5338058Z [command]C:\hostedtoolcache\windows\dotnet\dotnet.exe restore d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool.csproj --configfile d:\a\_temp\Nuget\tempNuGet_05ce1f4cc83beb812b37be120d7010969ab1a363.config --verbosity Detailed
2019-10-03T21:30:31.1552382Z
2019-10-03T21:30:31.1633338Z Welcome to .NET Core!
2019-10-03T21:30:31.1633445Z ---------------------
2019-10-03T21:30:31.1633487Z Learn more about .NET Core: https://aka.ms/dotnet-docs
2019-10-03T21:30:31.1633556Z Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
2019-10-03T21:30:31.1633582Z
2019-10-03T21:30:31.1633618Z Telemetry
2019-10-03T21:30:31.1633654Z ---------
2019-10-03T21:30:31.1633712Z The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
2019-10-03T21:30:31.1633881Z
2019-10-03T21:30:31.1633924Z Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
2019-10-03T21:30:31.1684350Z
2019-10-03T21:30:31.1686360Z Configuring...
2019-10-03T21:30:31.1686911Z --------------
2019-10-03T21:30:31.1687446Z A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once.
2019-10-03T21:30:44.4629886Z Decompressing .......... 13256 ms
2019-10-03T21:31:36.6357349Z Expanding .......... 51984 ms
2019-10-03T21:31:38.0761886Z
2019-10-03T21:31:38.0762691Z ASP.NET Core
2019-10-03T21:31:38.0762874Z ------------
2019-10-03T21:31:38.0763054Z Successfully installed the ASP.NET Core HTTPS Development Certificate.
2019-10-03T21:31:38.0763284Z To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation.
2019-10-03T21:31:38.0763446Z For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
2019-10-03T21:31:38.4176357Z Build started 10/3/2019 9:31:38 PM.
2019-10-03T21:31:38.9605866Z 0>Resolving SDK 'Microsoft.NET.Sdk'...
2019-10-03T21:31:38.9816247Z Property reassignment: $(MSBuildProjectExtensionsPath)="d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\obj\" (previous value: "obj\") at C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Current\Microsoft.Common.props (56,5)
2019-10-03T21:31:38.9833374Z Property reassignment: $(MSBuildAllProjects)=";C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props;C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props" (previous value: ";C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props") at C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props (15,5)
2019-10-03T21:31:38.9949011Z Property reassignment: $(MSBuildAllProjects)=";C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props;C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props;C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.props" (previous value: ";C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props;C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props") at C:\hostedtoolcache\windows\dotnet\sdk\2.2.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.props (21,5)
...
...
...
2019-10-03T21:31:47.9997847Z Generating MSBuild file d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\GDPR.OutputProvider\obj\GDPR.OutputProvider.csproj.nuget.g.props.
2019-10-03T21:31:47.9998017Z Generating MSBuild file d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\GDPR.OutputProvider\obj\GDPR.OutputProvider.csproj.nuget.g.targets.
2019-10-03T21:31:48.0229473Z Writing assets file to disk. Path: d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\GDPR.OutputProvider\obj\project.assets.json
2019-10-03T21:31:48.0229714Z Checking compatibility of packages on .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0229774Z Checking compatibility for GDPR.Output.IO 1.0.0 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0229817Z Checking compatibility for NETStandard.Library 2.0.3 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0229859Z Checking compatibility for GDPR.Common 1.0.0 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0229916Z Checking compatibility for GDPR.Logger 1.0.0 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0229955Z Checking compatibility for GDPR.ObjectModel 1.0.0 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0229996Z Checking compatibility for WindowsAzure.Storage 9.3.3 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0230054Z Checking compatibility for Microsoft.NETCore.Platforms 1.1.0 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0230299Z Checking compatibility for Microsoft.Azure.KeyVault 3.0.3 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0230341Z Checking compatibility for Microsoft.Azure.Management.KeyVault 2.4.3 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0230394Z Checking compatibility for Microsoft.Azure.Services.AppAuthentication 1.0.3 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0230457Z Checking compatibility for Microsoft.IdentityModel.Clients.ActiveDirectory 5.0.5 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0230500Z Checking compatibility for Microsoft.Rest.ClientRuntime.Azure.Authentication 2.4.0 with .NETStandard,Version=v2.0.
2019-10-03T21:31:48.0230543Z Checking compatibility for System.Security.Cryptography.X509Certificates 4.3.2 with .NETStandard,Version=v2.0.
...
...
...
2019-10-03T21:31:54.4289388Z All packages and projects are compatible with .NETCoreApp,Version=v2.1.
2019-10-03T21:31:54.4454996Z Committing restore...
2019-10-03T21:31:54.4459080Z Generating MSBuild file d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\obj\MyTool.csproj.nuget.g.props.
2019-10-03T21:31:54.4460039Z Generating MSBuild file d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\obj\MyTool.csproj.nuget.g.targets.
2019-10-03T21:31:54.4461496Z Writing assets file to disk. Path: d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\obj\project.assets.json
2019-10-03T21:31:54.4567260Z Writing cache file to disk. Path: d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\obj\MyTool.csproj.nuget.cache
2019-10-03T21:31:54.4573630Z Restore completed in 4.12 sec for d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool.csproj.
2019-10-03T21:31:54.4661557Z
2019-10-03T21:31:54.4662703Z NuGet Config files used:
2019-10-03T21:31:54.4663349Z d:\a\_temp\Nuget\tempNuGet_05ce1f4cc83beb812b37be120d7010969ab1a363.config
2019-10-03T21:31:54.4664039Z
2019-10-03T21:31:54.4664744Z Feeds used:
2019-10-03T21:31:54.4665067Z https://api.nuget.org/v3/index.json
2019-10-03T21:31:54.4785886Z
2019-10-03T21:31:54.4786633Z Installed:
2019-10-03T21:31:54.4796944Z 7 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\MyTool.Logger\MyTool.Logger.csproj
2019-10-03T21:31:54.4803020Z 32 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\MyTool.Common\MyTool.Common.csproj
2019-10-03T21:31:54.4803472Z 33 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\MyTool.OutputProvider\MyTool.OutputProvider.csproj
2019-10-03T21:31:54.4803792Z 34 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\MyTool.Output.IO\MyTool.Output.IO.csproj
2019-10-03T21:31:54.4804056Z 33 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\MyTool.SearchFilter\MyTool.SearchFilter.csproj
2019-10-03T21:31:54.4804362Z 32 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\MyTool.PiiData\MyTool.PiiData.csproj
2019-10-03T21:31:54.4805159Z 42 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool\MyTool.SearchHandler\MyTool.SearchHandler.csproj
2019-10-03T21:31:54.4805573Z 42 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool.App\MyTool.App.csproj
2019-10-03T21:31:54.4805849Z 46 package(s) to d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool.csproj
2019-10-03T21:31:54.4806121Z Done executing task "RestoreTask".
2019-10-03T21:31:54.4806389Z 1>Done building target "Restore" in project "MyTool.csproj".
2019-10-03T21:31:54.4806658Z 1>Done Building Project "d:\a\r1\a\MyTool\DataFactory\CustomActivities\MyTool\MyTool.csproj" (Restore target(s)).
2019-10-03T21:31:54.5031887Z
2019-10-03T21:31:54.5032209Z Build succeeded.
2019-10-03T21:31:54.5032251Z 0 Warning(s)
2019-10-03T21:31:54.5032319Z 0 Error(s)
2019-10-03T21:31:54.5032343Z
2019-10-03T21:31:54.5032377Z Time Elapsed 00:00:16.08
2019-10-03T21:31:54.5417968Z ##[section]Finishing: dotnet restore
Any clues what could be going wrong?
This was happening because I had something in the 'Working Directory'. I just cleared the "Working directory" field. Before I had set it to the subfolder containing the .csproj file which was incorrect. The working directory should be the root.

VSTS - dotnet restore - PackageCache doesn't exist

I'm trying to build a .net core webapi project on a vsts hosted agent.
I use the same yaml accross multiple projects and it works fine:
- task: DotNetCoreCLI#1
displayName: Restore
inputs:
command: restore
projects: '$(ProjectName).Backend/*.csproj'
However, today, on a new project, the dotnet restore gave me the following error:
2018-06-23T09:23:21.5607282Z ##[section]Starting: Restore
2018-06-23T09:23:21.5610673Z ==============================================================================
2018-06-23T09:23:21.5610898Z Task : .NET Core
2018-06-23T09:23:21.5611078Z Description : Build, test and publish using dotnet core command-line.
2018-06-23T09:23:21.5611445Z Version : 1.0.2
2018-06-23T09:23:21.5612188Z Author : Microsoft Corporation
2018-06-23T09:23:21.5612456Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2018-06-23T09:23:21.5613271Z ==============================================================================
2018-06-23T09:23:22.0071300Z [command]"C:\Program Files\dotnet\dotnet.exe" restore D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj
2018-06-23T09:23:24.2324967Z Restoring packages for D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj...
2018-06-23T09:23:24.5505741Z Restoring packages for D:\a\1\s\MyApp.Dtos\MyApp.Dtos.csproj...
2018-06-23T09:23:24.5506660Z C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets(114,5): error : The local source 'D:\a\1\s\PackageCache' doesn't exist. [D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj]
2018-06-23T09:23:25.8083235Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2018-06-23T09:23:25.8094330Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj
2018-06-23T09:23:25.8105780Z ##[section]Finishing: Restore
While I don't understand why I got the error on that project and not on others, it disappeared once I upgraded the vsts task to DotNetCoreCLI#2.

dotnet publish "Unable to load the service index for source https://api.nuget.org/v3/index.json"

I am getting the error message
Unable to load the service index for source https://api.nuget.org/v3/index.json'
on executing dotnet publish. dotnet restore is working fine with leveraging a local NuGet repository (Artifactory). The system I am running this on has no internet connection. But why does dotnet publish reach out to nuget.org? And is there a way to prevent this happening?
D:\tools\dotnet\dotnet.exe publish proj.sln --configuration Release --output bin/Release/PublishOutput
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json[D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : An error occurred while sending the request. [D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : The operation timed out [D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
My .NET enviroment
dotnet --info
.NET Command Line Tools (2.0.0)
Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9
Runtime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64
Base Path: D:\tools\dotnet\sdk\2.0.0\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
Updating to 2.0.5 solved this.

Port framework 4.6 to asp.net core 1

I can't build a few test proyect that we have migrated from fwk 4.6 to asp.net core 1.
Here are the output result of build:
15>------ Rebuild All started: Project: EbookingCoreTest, Configuration: Debug Any CPU ------
15>Build started 31/8/2016 7:42:47 p. m..
15> 1>
15>CoreCompile:
15> C:\Program Files\dotnet\dotnet.exe build "D:\eBookingV4\tst\EbookingCoreTest" --configuration Debug --no-dependencies --no-incremental
15> Project EbookingCoreTest (.NETStandard,Version=v1.6) will be compiled because project is not safe for incremental compilation. Use --build-profile flag for more information.
15> Compiling EbookingCoreTest for .NETStandard,Version=v1.6
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : Can not find runtime target for framework '.NETStandard,Version=v1.6' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : 1. The project has not been restored or restore failed - run dotnet restore
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : 2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
15> 1>
15>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : 3. You may be trying to publish a library, which is not supported. Use dotnet pack to distribute libraries.
15>
15>Build FAILED.
15>
dotnet --info
.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Anybody know why is this error?
My guess is that you probably have to include this in you project.json as exactly described in the error message
"runtimes": {
"win10-x64": {}
}
But that would have been better to include your full project.json with your question. We have too few information now.

Resources