操作系统是Ubuntu。
.NET Core SDK的版本是:
.NET Command Line Tools (1.0.0-preview1-002702)
prject.json文件的内容是:
{
"compilationOptions": {
"preserveCompilationContext": true,
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNetCore.HttpOverrides": "1.0.0-*",
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"portable-net45+wp80+win8+wpa81+dnxcore50",
"portable-net45+win8+wp8+wpa81",
"portable-net45+win8+wp8"
]
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*"
}
}
dotnet restore时的错误如下:
Unable to resolve 'Microsoft.AspNetCore.IISPlatformHandler (>= 1.0.0)' for '.NETCoreApp,Version=v1.0'. Package Newtonsoft.Json 7.0.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Newtonsoft.Json 7.0.1 supports: - net20 (.NETFramework,Version=v2.0) - net35 (.NETFramework,Version=v3.5) - net40 (.NETFramework,Version=v4.0) - net45 (.NETFramework,Version=v4.5) - portable-dnxcore50+net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net45+wp80+win8+wpa81+dnxcore50) - portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328) One or more packages are incompatible with .NETCoreApp,Version=v1.0.
在project.json中
1)参考这里将
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*"
}
改为
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools":{
"version":"1.0.0-*",
"imports": "portable-net45+win8+dnxcore50"
}
}
解决了“Package Newtonsoft.Json 7.0.1 is not compatible with netcoreapp1.0”的问题。
2)将
Microsoft.AspNetCore.IISPlatformHandler
改为
Microsoft.AspNetCore.Server.IISIntegration
解决了不能解析 Microsoft.AspNetCore.IISPlatformHandler 的问题。
因为 Newtonsoft.Json 7.0.1 不兼容?
请问我的outputpath是自定义的生成的到另一个目录下的结构和原来的一到处,使用IOC时如何调试呢? ResolvedPath不是预期的值啊
我对这个没经验