I have written a .NET Class library (a WS-Security based web-service proxy
client), which is invokable via .NET Interop from ASP 2.0 Classic.  The
Class library is
1) registered to GAC
2) type library registered using regasm /tlb

It has all been working fine until I added a single line of log4net code!
    private static readonly log4net.ILog log =
log4net.LogManager.GetLogger("Order");  


The .NET Class library is referencing the Released assembly of log4net
1.2.0beta8.

I get error '80131534' when instantiating the Object as follows:
    Dim objOrderClient
    Set objOrderClient = CreateObject("MyOrg.web.publications.Order")

Has anyone any experience in using log4net under .NET interop?  Note, for
the interopable to work, I had to get the Order class to implement the
IOrder interface, which is marked as
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)

Code snippet as follows
/***************Start of Order.cs***************/
using System.Diagnostics;
using System.Configuration;
using System.Xml.Serialization;
using System;
using System.IO;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
using System.Runtime.InteropServices;
using Microsoft.Web.Services2.Security;
using Microsoft.Web.Services2.Security.Tokens;
using Microsoft.Web.Services2.Security.X509;

namespace MyOrg.web.publications
{
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.ComponentModel.DesignerCategoryAttribute("code")]
        [System.Web.Services.WebServiceBindingAttribute(Name="iOrderSoap",
Namespace="http://publisher/webservices/";)]
        public class Order :
Microsoft.Web.Services2.WebServicesClientProtocol , IOrder
        {

                public Order() 
                {
                        this.Url = "https://publisher/order.asmx";;
                        
                        //Don't even border with this.  The class fail to
instantiate before this point!
                        //log4net.Config.DOMConfigurator.Configure();
                }
        
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://publisher
/webservices/PlaceOrder", RequestNamespace="http://publisher/webservices/";,
ResponseNamespace="http://publisher/webservices/";,
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
                public string PlaceOrder([MarshalAs(UnmanagedType.IUnknown)]
SimpleOrderData order) 
                {
                        //what this does is irrelevant here
                }
        }
}
/***************End of Order.cs***************/


/***************Start of IOrder.cs***************/
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.Web.Services;
using System.Runtime.InteropServices;


namespace MyOrg.web.publications
{
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
        public interface IOrder 
        {
    
   
        
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://publisher
/webservices/PlaceOrder", RequestNamespace="http://publisher/webservices/";,
ResponseNamespace="http://publisher/webservices/";,
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
                string PlaceOrder([MarshalAs(UnmanagedType.IUnknown)]
SimpleOrderData order) ;



        }
}
/***************End of IOrder.cs***************/

Reply via email to