我是单声道 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?
我错过了什么吗?
最佳答案
这是一个临时答案,因为我认为这可能只是一种变通方法。如果我直接在编译中包含 dll,它似乎可以正确编译
# mcs TestApp.cs -r:Npgsql.dll
关于c# - 未找到单声道 GAC DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51282856/