Always get latest Microsoft.NETCore.App after restore
See original GitHub issueI updated my dotnet cli yesterday and the version I got is 1.0.0-rc2-002464.
But today, when I wanted to create and build a project, it always failed.
The dependencies node in project.json.
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002464"
}
}
Is there a way to tell the dotnet cli only get the dependencies in the exactly same version which is declared in project.json instead of latest version?
Steps to reproduce
- Run dotnet new
- Add NuGet.config per https://github.com/dotnet/cli/issues/2545
- Run dotnet restore
- Run dotnet build
- Run dotnet run
Expected behavior
Run the application after build without problem
Actual behavior
Restore warning: warn : Dependency specified was Microsoft.NETCore.App (>= 1.0.0-rc2-3002464) but ended up with Microsoft.NETCore.App 1.0.0-rc2-3002468.
Build warning: warning NU1007: Dependency specified was Microsoft.NETCore.App >= 1.0.0-rc2-3002464 but ended up with Microsoft.NETCore.App 1.0.0-rc2-3002468.
Run error: Expected to load libhostpolicy.dylib from [/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-3002468] This may be because the targeted framework [“Microsoft.NETCore.App”: “1.0.0-rc2-3002468”] was not found.
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-rc2-002464)
Product Information: Version: 1.0.0-rc2-002464 Commit Sha: 8313400465
Runtime Environment: OS Name: Mac OS X OS Version: 10.11 OS Platform: Darwin RID: osx.10.11-x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top GitHub Comments
我之前试了试 ,如果改成2400 他就会下大于或等于 2400的, 如果改成2450就会下大于或等于2450的。 这个版本小于你安装的netcore版本 ,编译和运行都没问题 ,大于就不行了
应该是服务器上没有对应版本,就取了一个比他略大的版本,试试把1.0.0-rc2-3002464 改得小一点 ,比如1.0.0-rc2-3002400,这样应该就能编译了