【问题标题】:Asp.Net using dll with web application projectAsp.Net 使用带有 Web 应用程序项目的 dll
【发布时间】:2012-08-02 11:21:20
【问题描述】:

我正在开发一个 asp.net Web 应用程序项目。我已经使用添加引用命令添加了一个 dll 文件,但是当我使用 namespace_name 说它时出现错误。

注意:我尝试作为 Asp.Net 网站。但问题是 continue。我检查了框架版本。

C#:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DenemePc; <-- dll file

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

错误:

'DenemePc' 可以找到类型或命名空间名称(您是否缺少 using 指令或程序集引用?)

【问题讨论】:

  • 能否请您发布您遇到的错误?

标签: c# asp.net dll class-library


【解决方案1】:

我相信我已经回答了类似的问题ASP.NET => Compiler Error Message: CS0246: The type or namespace name 'HtmlAgilityPack'

请在 DenemePc 的引用 DLL 上将 Copy Local 属性设置为 True

这会将 dll 复制到应用程序的输出目录

【讨论】:

  • 我如何设置复制本地为真?我看属性。没有复制本地属性。
  • 我找到了这个属性。它检查为真,但我仍然得到同样的错误。
  • Error;'DenemePc' 可以找到类型或命名空间名称(是否缺少 using 指令或程序集引用?)错误代码为 CS0246。
  • @Bombula 您是否在 DenemePc dll 上将 Copy Local 设置为 True ?
  • 你的 dll 中方法的所有权限是否与调用它们的方法兼容?如果您使用“受保护”而不是“公共”,这可能是原因。
猜你喜欢
  • 2015-06-03
  • 1970-01-01
  • 1970-01-01
  • 2011-10-04
  • 1970-01-01
  • 1970-01-01
  • 2010-09-25
  • 1970-01-01
  • 2014-06-09
相关资源
最近更新 更多