[英]Build web api .net core on linux
I'm using continuous integration with Microsoft (R) Visual Studio (R) Team Services . 我正在与Microsoft(R)Visual Studio(R)Team Services进行持续集成。 After the dotnet restore
command which successfully runs on my ubnuntu server, then I run the build command dot net build
and the next error occurs: 在成功在我的ubnuntu服务器上运行的dotnet restore
命令之后,我运行了build命令dot net build
并发生下一个错误:
(GetReferenceAssemblyPaths target) -> /usr/share/dotnet/sdk/1.0.0-preview3-004056/Microsoft.Common.CurrentVersion.targets(1107,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
What did I wrong? 我怎么了 I tried to modify the .net version to 4.0, I also looked into some commands to get the targeting pack for linux but I can't find a solution. 我尝试将.net版本修改为4.0,我还研究了一些命令以获取linux的目标包,但找不到解决方案。
My system runs: 我的系统运行:
Based on the error, your project references to .net framework 4.5, you need to reference to .net core. 基于该错误,您的项目引用.net framework 4.5,因此您需要引用.net core。
Code: 码:
"frameworks": {
//"net452": { }
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.