linux下借助mono编译C#提示未引用程序集(error CS0234)

作者: WePlayDirty 2017-01-17 10:05:37

程序中using System.NET.Http,编译时报错:test.cs(5,18): error CS0234: The type or namespace name `Http' does not exist in the namespace `System.Net'. Are you missing `System.Net.Http' assembly reference?


 


找了半天,才看明白应该是忘了引用使用的程序集(reference *.dll),在windows下用vs可以添加引用,在Linux下编译的时候添加reference就行了。


 


编译时使用mcs /reference:System.Net.Http.dll test.cs 或则gmcs /reference:System.Net.Http.dll test.cs就行了。


 


如下图:






 


本文永久更新地址:http://www.linuxdiyf.com/linux/27884.html

相关资讯