c# - 未找到单声道 GAC DLL

标签 c# linux dll mono

我是单声道 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/

相关文章:

c - read() 在套接字编程中不阻塞

dll - 使用本地类库作为 Web API 的资源(ASP.NET Core 1.0)

c# - 从项目中删除引用 .dll 后如何找到它

c# - 如何摆脱 Visual Studio 2010 中烦人的代码提示?

c# - 以 asp-for 作为参数的自定义 ViewComponent

c# - Visual Studio 项目 : How to include a reference for one configuration only?

linux - 使用 nodebox 作为 python 3.5 的模块

linux - 如何从 pcap 中提取特定的子层?

c# - 用于从字符串中删除 HTML 的 .Net 函数?

c++ - 从外部代码加载阶段