我正在尝试使用
在ubuntu命令行上运行一个csharp程序mcs hello.cs
它可以工作,但是我想使用我在nuget CLI中下载的nuget,如下所示:
using Mailjet.Client;
using Mailjet.Client.Resources;
using System;
using Newtonsoft.Json.Linq;
namespace Mailjet.ConsoleApplication {
class Program {
static void Main(string[] args) {
RunAsync().Wait();
}
..........
然后我得到了错误:
hello.cs(1,15): error CS0234: The type or namespace name `Client' does not exist in the namespace `Mailjet'. Are you missing an assembly reference?
hello.cs(2,15): error CS0234: The type or namespace name `Client' does not exist in the namespace `Mailjet'. Are you missing an assembly reference?
hello.cs(4,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?
所以我参考了一个SO答案并尝试了
mcs /reference:Mailjet.Api.1.2.2 /reference:Newtonsoft.Json.9.0.1 hello.cs
现在我遇到了另一个错误
error CS0006: Metadata file `Mailjet.Api.1.2.2' could not be found
error CS0006: Metadata file `Newtonsoft.Json.9.0.1' could not be found
我尝试了其他方法
mcs hello.cs -r:Mailjet.Api.1.2.2 -r:Newtonsoft.Json.9.0.1
但没有区别
这是我的目录结构
.
├── Mailjet.Api.1.2.2
│ ├── Mailjet.Api.1.2.2.nupkg
│ └── lib
│ ├── net45
│ │ └── Mailjet.Client.dll
│ └── netstandard1.1
│ └── Mailjet.Client.dll
├── Newtonsoft.Json.9.0.1
│ ├── Newtonsoft.Json.9.0.1.nupkg
│ ├── lib
│ │ ├── net20
│ │ │ ├── Newtonsoft.Json.dll
│ │ │ └── Newtonsoft.Json.xml
│ │ ├── net35
│ │ │ ├── Newtonsoft.Json.dll
│ │ │ └── Newtonsoft.Json.xml
│ │ ├── net40
│ │ │ ├── Newtonsoft.Json.dll
│ │ │ └── Newtonsoft.Json.xml
│ │ ├── net45
│ │ │ ├── Newtonsoft.Json.dll
│ │ │ └── Newtonsoft.Json.xml
│ │ ├── netstandard1.0
│ │ │ ├── Newtonsoft.Json.dll
│ │ │ └── Newtonsoft.Json.xml
│ │ ├── portable-net40+sl5+wp80+win8+wpa81
│ │ │ ├── Newtonsoft.Json.dll
│ │ │ └── Newtonsoft.Json.xml
│ │ └── portable-net45+wp80+win8+wpa81
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ └── tools
│ └── install.ps1
├── hello.cs
├── hello.exe
└── tree.txt
14 directories,22 files
请帮助我。我不想使用Visual Studio IDE