Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2004

Tip: Looking for answers? Try searching our database.

Interop problems with >1 assemblies

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patrick - 29 Nov 2004 17:51 GMT
I have a .NET web service proxy client that is intended to be invokable from
ASP 2.0 (Classic as follows)

MyOrg.web.publications.OrderData  - Data class that is at the highest level
MyOrg.web.publications.iOrderData - Interface for
MyOrg.web.publications.OrderData
MyOrg.web.publications.OrderLines - MyOrg.web.publications.OrderData
contain these
MyOrg.web.publications.iOrderLines - interface for
MyOrg.web.publications.OrderLines
MyOrg.web.publications.Order          - the actual web service proxy client
built using WSE 2.0
MyOrg.web.publications.iOrder         - interface for
MyOrg.web.publications.iOrder

The interfaces were present because I need it for interop to work.

1) Interfaces are defined as
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
2) classes are set to implement their corresponding interfaces
3) Methods are marshalled like this:
public string PlaceOrder([MarshalAs(UnmanagedType.IUnknown)] OrderData
order)

Two Problems
1) These all work fine when they are in the same Visual Studio 2003 project
in the same class library project.  However, if I put the data sturcture
classes/assemblies in one assembly, and Order,iOrder in another, when
PlaceOrder is invoked from ASP2.0 (Classic), I get a "Object reference not
set to an instance ....." exception!

2) I can't get log4net working! The following SINGLE line of code would
cause failure!:
private static readonly log4net.ILog log =
log4net.LogManager.GetLogger("Order");

I am using version 1.2.0 Beta8 of log4net at
http://prdownloads.sourceforge.net/log4net/log4net-1.2.0-beta8.zip?download

Are these two problems related ?(i.e., interop having problem with using
classes from a different assembly).  Note, I seem to be able to use other
.NET classes (e.g.System.Diagnostics.EventLog), although it is preferable to
use a more scalable logging tool like log4NET or the Microsoft Logging
application block).

How could I fix this?
Patrick - 30 Nov 2004 12:29 GMT
Is it true that I can't use static members within a .NET Class library if it
were to be exposed to COM client (ASP 2.0 Classic) via regasm?

Note
1) the log4net log variable is a PRIVATE static variable that is used
internally (but not exposed)
2) the data classes used (when split into 2 assemblies) are NOT static
members
3) I manage to use the "native" System.Diagnostic.Eventlog.WriteEvent STATIC
method OK with no problem.

> I have a .NET web service proxy client that is intended to be invokable from
> ASP 2.0 (Classic as follows)
[quoted text clipped - 33 lines]
>
> I am using version 1.2.0 Beta8 of log4net at

http://prdownloads.sourceforge.net/log4net/log4net-1.2.0-beta8.zip?download

> Are these two problems related ?(i.e., interop having problem with using
> classes from a different assembly).  Note, I seem to be able to use other
[quoted text clipped - 3 lines]
>
> How could I fix this?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.