未找到单声道 GAC DLL
Mono GAC DLL Not Found
我对单声道 C# 开发还很陌生,我在将外部 DLL 包含到我的应用程序中时遇到了问题。
我正在使用 CentOS 7,试图包含 Npgsql.dll 模块。
目前我的应用程序如下
using System;
using System.IO;
using Npgsql;
public class TestApp {
static public void Main(string[] la_args) {
Console.WriteLine("Nothing");
}
}
我将 Npgsql.dll 纳入了 GAC
# gacutil -i Ngsql.dll
# Installed Npgsql.dll into the gac (/usr/local/lib/mono/gac)
但是当我尝试编译它时仍然会产生错误
# mcs TestApp.cs
# error CS0246: The type or namespace name `Npgsql' could not be found. Are you missing an assembly reference?
我是不是漏掉了什么?
这是一个临时答案,因为我认为这可能只是一种变通方法。如果我直接在 compile
中包含 dll,它似乎编译正确
# mcs TestApp.cs -r:Npgsql.dll
我对单声道 C# 开发还很陌生,我在将外部 DLL 包含到我的应用程序中时遇到了问题。
我正在使用 CentOS 7,试图包含 Npgsql.dll 模块。
目前我的应用程序如下
using System;
using System.IO;
using Npgsql;
public class TestApp {
static public void Main(string[] la_args) {
Console.WriteLine("Nothing");
}
}
我将 Npgsql.dll 纳入了 GAC
# gacutil -i Ngsql.dll
# Installed Npgsql.dll into the gac (/usr/local/lib/mono/gac)
但是当我尝试编译它时仍然会产生错误
# mcs TestApp.cs
# error CS0246: The type or namespace name `Npgsql' could not be found. Are you missing an assembly reference?
我是不是漏掉了什么?
这是一个临时答案,因为我认为这可能只是一种变通方法。如果我直接在 compile
中包含 dll,它似乎编译正确# mcs TestApp.cs -r:Npgsql.dll