【发布时间】:2009-10-15 20:59:51
【问题描述】:
我创建了一个类库并构建了一个 dll(发布版本)。然后我在另一个项目中引用了 DLL(我尝试了几个)。我可以在对象浏览器中看到命名空间和类,我可以声明类的实例,但我无法使用或查看任何方法或属性!没有任何 IntelliSense,手动调用方法会导致“预期声明”错误。
在类库解决方案中,我有一个引用类库项目的单元测试项目,它工作正常(并且所有测试都通过)。
任何人都可以提供任何关于这里可能出现问题的指针吗?我过去构建了很多 dll,并且完全没有遇到任何问题。
**EDIT:示例类(如您所见非常简单)
Public Class NTSCurrency
Implements IComparable
Public Sub New()
End Sub
Public Sub New(ByVal code As String, ByVal name As String)
_Code = code
_Name = name
End Sub
Private _Code As String
Private _Name As String
Public Property Code() As String
Get
Return _Code
End Get
Set(ByVal value As String)
_Code = value
End Set
End Property
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
Public Overrides Function ToString() As String
Return Me.Name
End Function
Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
Dim cur As NTSCurrency = CType(obj, NTSCurrency)
Return Name.CompareTo(cur.Name)
End Function
End Class
** 更新:刚刚使用现有解决方案测试了这个 dll,它工作正常。是否有新项目的设置?
【问题讨论】: