在Visual Studio 2008中添加dll作为vb.net中web服务的引用

时间:2014-09-11 06:23:36

标签: asp.net vb.net web-services dll

我们已经创建了一个dll,它在vb.net应用程序中工作得很好,当我们在visual studio 2008中通过add reference引用时。但是我需要创建一个web服务来调用这个dll,所以所有操作都是dll可以通过webservice调用。这是项目的目标。我在vs2008中创建了webservice并添加了位于本地磁盘中的dll的引用。但是当我尝试构建webservice时,它会抛出以下错误。< / p>

Could not load file or assembly 'COMWrapper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

操作系统:Windows 7 64位 Visual Studio 2008 3.5 .Net框架 编程语言:Vb.net

以下是我在VB中创建的网络服务

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
     Inherits System.Web.Services.WebService

    Dim oXRay As New COMClient.DLLCOMWrapper

    <WebMethod()> _
    Public Function TagDocWithRTFDoc(ByVal FileContent() As Byte, ByVal Ext As String) As String
        Dim result As String

        result = oXRay.TagDocWithRTFOutput(FileContent, Ext)
        Return result
    End Function

    <WebMethod()> _
   Public Function TagDocument(ByVal FileContent() As Byte, ByVal Ext As String) As String
        Dim result As String

        result = oXRay.TagDoc(FileContent, Ext)
        Return result
    End Function

    <WebMethod()> _
  Public Function ConvertDocument(ByVal FileContent() As Byte, ByVal Ext As String) As String
        Dim result As String

        result = oXRay.ConvertDoc(FileContent, Ext)
        Return result
    End Function

    <WebMethod()> _
    Public Function Info() As String
        Dim result As String

        result = oXRay.GetLicenseInfo
        Return result
    End Function

End Class

0 个答案:

没有答案