Jump to content
Xtreme .Net Talk

.NET Interop for MSXML6 on IIS 6 - Error: COM not valid or registered


Recommended Posts

Posted

I am having some difficulty deploying a web service I have created in VB .NET. The application works fine on my development PC and on Server1 (with IIS 5.0). However, the application gives an error when invoked on Server2 (IIS 6.0). After some investigation I have discovered that the error is related to the MSXML libraries.

 

I have only one web method called �Hello World� in the web service. The �Hello World� service simply returns an XML string.

 

Server1 correctly returns: <?xml version="1.0" encoding="utf-8" ?> <string xmlns="testObjects">Hello World</string>

 

Server2 returns this error: COM object with CLSID {88D969C0-F192-11D4-A65F-0040963251E5} is either not valid or not registered.

 

This is the entire code in the web service:

 

 

Imports System.Web.Services

<System.Web.Services.WebService(Namespace:="testObjects")> _

Public Class Service1

Inherits System.Web.Services.WebService

Public Sub New()

MyBase.New()

InitializeComponent()

End Sub

Private components As System.ComponentModel.IContainer

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

components = New System.ComponentModel.Container

End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

<WebMethod()> _

Public Function HelloWorld() As String

Dim x As New Interop.CF.clsPort

Dim y As New Interop.INC.MathActiveX

Dim z As New Interop.MSXML6.DOMDocument40

Return "Hello World"

End Function

End Class

 

Notice all I am doing in the WebMethod HelloWorld() is creating a series of objects. The first two are COM Interop libraries (a .NET Wrapper for COM objects) based off of two objects that on of my developers created in classic VB CF.dll and INC.dll. Both of these COM DLLs are registered on both Server1 and Server2. I know this because these two lines of code execute no problem, so all is good with the underlying DLLs that these wrappers are calling. However, when I go to create �z� I get the error I pasted above. Interop.MSXML6 is a wrapper created from MSXML6.DLL, the most recent version of MSXML from Microsoft. I installed this version on both servers yesterday. Also, all of these Interop assemblies are strong name assemblies, meaning when I used the TLBIMP utility to create them I specified a �Strong Name Key File�.

 

I have tried using Interops based on MSXML3, MSXML4, MSXML5, and MSXML6. All three work fine on Server1 and none have worked on Server2. Also, I have been getting the exact same error since the beginning. Here�s the real kicker. As I moved down version after version, still the same result Server1, good, Server2, bad. HOWEVER, when I created an Interop from MSXML2.DLL the app ran correctly on Server2. GREAT! I thought, BUT when I tested it on Server1, same error I had been getting gone Server2. So this is where I am.

 

Remember this app works great on my development server and Server1. So it seems to me that the question is �What�s the difference?�. I would say just about everything since one box has IIS 5 and the other IIS 6. I hope this information points you in the right direction. I have been working on this problem for over 2 weeks now. Any assistance would be greatly appreciated.

 

Thank you.

  • Administrators
Posted

This could be down to the increased security in Windows 2003, have you checked it's IIS configuration to see if there are any settings that could prevent COM objects loading?

 

Also if you are developing in .Net why are you using interop to access the COM based MSXMLx libraries instead of using the classes under System.XML?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
This could be down to the increased security in Windows 2003, have you checked it's IIS configuration to see if there are any settings that could prevent COM objects loading?

 

Also if you are developing in .Net why are you using interop to access the COM based MSXMLx libraries instead of using the classes under System.XML?

 

Because I am loading an ADODB recordset from an XML string that was created with the following: Recordset.Save(adodbXML, ADODB.PersistFormatEnum.adPersistXML)

 

Here is how I convert the XML string back to an ADODB.Recordset

 

Dim oXML As New DOMDocument40 ' xml document object

Dim rst As New ADODB.Recordset ' ADODB recordset

Dim stream As New ADODB.Stream ' ADODB stream

Call oXML.loadXML(adodbXML) ' load saved xml into DOM doc

stream.Open() : oXML.save(stream) ' open a stream and load xml into stream

stream.Position = 0 : rst.Open(stream) ' open recordset from xml stream

stream.Close()

rst.Close()

oXML = Nothing

stream = Nothing

rst = Nothing

 

 

If you can tell me how to avoid this, I would love it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...