在 dotnet 核心中以不同的依赖版本结束
Ending up with different dependency version in dotnet core
我正在开展一个针对 netstandard1.6
和 net451
的项目。
不幸的是,我在构建我的库时收到了这些警告:
C:\Path\project.json(22,35): warning NU1007: Dependency specified was Microsoft.CSharp >= 4.0.1 but ended up with Microsoft.CSharp 4.0.0.0.
C:\Path\project.json(17,38): warning NU1007: Dependency specified was System.Collections >= 4.0.11 but ended up with System.Collections 4.0.0.0.
C:\Path\project.json(18,30): warning NU1007: Dependency specified was System.Linq >= 4.1.0 but ended up with System.Linq 4.0.0.0.
C:\Path\project.json(19,33): warning NU1007: Dependency specified was System.Runtime >= 4.1.0 but ended up with System.Runtime 4.0.10.0.
C:\Path\project.json(20,49): warning NU1007: Dependency specified was System.Runtime.InteropServices >= 4.1.0 but ended up with System.Runtime.InteropServices 4.0.10.0.
C:\Path\project.json(21,36): warning NU1007: Dependency specified was System.Threading >= 4.0.11 but ended up with System.Threading 4.0.0.0.
这是我的project.json
:
{
"version": "1.0.0-*",
"description": "MyLibrary",
"frameworks": {
"net451": {
},
"netstandard1.6": {
}
},
"dependencies": {
"NETStandard.Library": "1.6.0",
"Newtonsoft.Json": "9.0.1",
"MyOtherProject.Common": "1.0.0-*",
"System.Collections": "4.0.11",
"System.Linq": "4.1.0",
"System.Runtime": "4.1.0",
"System.Runtime.InteropServices": "4.1.0",
"System.Threading": "4.0.11",
"Microsoft.CSharp": "4.0.1"
}
}
库构建没有针对 netstandard1.6
和 net451
的错误,但是我在构建 net451
.
时收到这些警告
有什么想法吗?
我也有同样的问题。
我的修复是删除警告
{
"version": "1.0.0-*",
"description": "MyLibrary",
"frameworks": {
"net451": {
"dependencies": {
"System.Collections": "4.0.0",
"System.Linq": "4.0.0",
"System.Runtime": "4.0.10",
"System.Runtime.InteropServices": "4.0.10",
"System.Threading": "4.0.0",
"Microsoft.CSharp": "4.0.0"
}
},
"netstandard1.6": {
"dependencies": {
"System.Collections": "4.0.11",
"System.Linq": "4.1.0",
"System.Runtime": "4.1.0",
"System.Runtime.InteropServices": "4.1.0",
"System.Threading": "4.0.11",
"Microsoft.CSharp": "4.0.1"
}
}
},
"dependencies": {
"NETStandard.Library": "1.6.0",
"Newtonsoft.Json": "9.0.1"
}
}
但我认为可能会有更好的解决方案。
我正在开展一个针对 netstandard1.6
和 net451
的项目。
不幸的是,我在构建我的库时收到了这些警告:
C:\Path\project.json(22,35): warning NU1007: Dependency specified was Microsoft.CSharp >= 4.0.1 but ended up with Microsoft.CSharp 4.0.0.0.
C:\Path\project.json(17,38): warning NU1007: Dependency specified was System.Collections >= 4.0.11 but ended up with System.Collections 4.0.0.0.
C:\Path\project.json(18,30): warning NU1007: Dependency specified was System.Linq >= 4.1.0 but ended up with System.Linq 4.0.0.0.
C:\Path\project.json(19,33): warning NU1007: Dependency specified was System.Runtime >= 4.1.0 but ended up with System.Runtime 4.0.10.0.
C:\Path\project.json(20,49): warning NU1007: Dependency specified was System.Runtime.InteropServices >= 4.1.0 but ended up with System.Runtime.InteropServices 4.0.10.0.
C:\Path\project.json(21,36): warning NU1007: Dependency specified was System.Threading >= 4.0.11 but ended up with System.Threading 4.0.0.0.
这是我的project.json
:
{
"version": "1.0.0-*",
"description": "MyLibrary",
"frameworks": {
"net451": {
},
"netstandard1.6": {
}
},
"dependencies": {
"NETStandard.Library": "1.6.0",
"Newtonsoft.Json": "9.0.1",
"MyOtherProject.Common": "1.0.0-*",
"System.Collections": "4.0.11",
"System.Linq": "4.1.0",
"System.Runtime": "4.1.0",
"System.Runtime.InteropServices": "4.1.0",
"System.Threading": "4.0.11",
"Microsoft.CSharp": "4.0.1"
}
}
库构建没有针对 netstandard1.6
和 net451
的错误,但是我在构建 net451
.
有什么想法吗?
我也有同样的问题。 我的修复是删除警告
{
"version": "1.0.0-*",
"description": "MyLibrary",
"frameworks": {
"net451": {
"dependencies": {
"System.Collections": "4.0.0",
"System.Linq": "4.0.0",
"System.Runtime": "4.0.10",
"System.Runtime.InteropServices": "4.0.10",
"System.Threading": "4.0.0",
"Microsoft.CSharp": "4.0.0"
}
},
"netstandard1.6": {
"dependencies": {
"System.Collections": "4.0.11",
"System.Linq": "4.1.0",
"System.Runtime": "4.1.0",
"System.Runtime.InteropServices": "4.1.0",
"System.Threading": "4.0.11",
"Microsoft.CSharp": "4.0.1"
}
}
},
"dependencies": {
"NETStandard.Library": "1.6.0",
"Newtonsoft.Json": "9.0.1"
}
}
但我认为可能会有更好的解决方案。