I am writing a application using ASP and VBScript. There a library I can only find one written for .Net application. So I tried to create a class library wrapper and compiled it to a DLL using VB.Net (Microsoft Visual Basic 2010 Express).
The DLL works in my own desktop (Windows 7) but it fails in the server (Server 2000).
Error message is "System cannot find the file specified"
Server config
OS: Microsoft Windows 2000 Server (SP4)
.Net framework installed: v2.0.50727
The code I wrote in my testing project is simply a class doing nothing.
Imports System.IO
Imports System
<ComClass(Object1.ClassId, Object1.InterfaceId, Object1.EventsId)> _
Public Class Object1
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "f5dcfb08-7a83-4501-bd89-03e38cad819c"
Public Const InterfaceId As String = "8a313e0b-60e5-4ff4-8a7d-e7b1582eec71"
Public Const EventsId As String = "fe55f7d8-691f-4c76-968a-37019fa9bb53"
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Public Sub Hello()
'...
End Sub
End Class
What I did :
Chose ".NET Framework 2.0" in Compile options
Compile it on my own desktop
Copied all file from the Bin\Release directly to a folder on the server.
Successfully registered the DLL on the server using Regasm.exe
but Object1 cannot be created using neither VB6 or VBScript.
Here is the script I used in a VBScript:
Option Explicit
Dim TestObject
Set TestObject = CreateObject("TestComObject.Object1")
Any help will be appreciated!
Alex