'IADsLargeInteger'在命名空间'ActiveDs'中不明确

问题描述 投票:0回答:1

我正在使用VB语言编写一个项目,当我尝试编译它时,我正面临这种类型的错误“'IADsLargeInteger'在命名空间'ActiveDs'中是不明确的”这是代码的一部分给我错误:

   Function GetLargeInteger(ByVal val As Int64) As 
    IADsLargeInteger
    Dim largeInt As New ActiveDs.LargeInteger

    largeInt.HighPart = CType((val >> 32), Integer)
    val = val << 32
    val = val >> 32
    largeInt.LowPart = (Convert.ToInt32(val))
    Return largeInt
End Function

我也导入了:

Imports Dar.DAL
Imports DbShare
Imports System.DirectoryServices
Imports System.Xml.Serialization
Imports System.IO
Imports Dar.BLL.Interfaces
Imports Dar.DAL.Repositories
Imports Dar.BLL.Services
Imports System.Security.Principal
Imports System.Threading
Imports System.Globalization
Imports Elmah
Imports System.Configuration
Imports ActiveDs

请帮助,因为我没有得到出错的地方

.net vb.net dll
1个回答
0
投票

错误消息告诉您的是IADsLargeInteger在某处定义了多次,编译器不知道使用哪一个。您要么必须删除一个定义(一个的imports语句),要么完全指向您要使用的定义。我假设你要使用的那个包含在ActiveDS中给出了largeint声明,所以更改你的函数以返回那个:

Function GetLargeInteger(ByVal val As Int64) As ActiveDS.IADsLargeInteger
    Dim largeInt As New ActiveDs.LargeInteger

    largeInt.HighPart = CType((val >> 32), Integer)
    val = val << 32
    val = val >> 32
    largeInt.LowPart = (Convert.ToInt32(val))
    Return largeInt
End Function
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.