我正在尝试使用Microsoft.AspNet.WebApi.Client包中的HttpClient访问REST服务
但是当我尝试构建我的应用程序时,我收到以下错误
Project ProjectTest (.NETCoreApp,Version=v1.0) will be compiled because inputs were modified
Compiling ProjectTest for .NETCoreApp,Version=v1.0
/.../code/.../src/ProjectTest/project.json(11,46): error NU1002:
The dependency Microsoft.AspNet.WebApi.Client 5.2.3
does not support framework .NETCoreApp,Version=v1.0.
我的project.json包含以下内容
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"
},
"Microsoft.AspNet.WebApi.Client": "5.2.3"
},
"frameworks": {
"netcoreapp1.0": {
"imports":"dnxcore50"
}
}
}
答案 0 :(得分:3)
您正在引用HttpClient的ASP.NET版本。 System.Net.Http.HttpClient中也存在一个,也许你有更好的运气。