Hi Bob, Let me confirm the facts here.
You created a VB6 component named "db_Models" If register "db_Models" with regsvr32 and then call it from a C# program it works as expected. I'm assuming that in your C# project you simply added a COM reference to this assembly to generate the interop assembly. If you then add the dll containing "db_Models" to a COM+ application (Library? Server? Does it matter?) your C# program is unable to call a method on "db_Models" (Any method? All methods?) I would be happy to help you but I need some more information. What platform? Is the COM+ app Server or Library? Is it just one method or any method? How did you generate the interop assembly, by adding a COM reference? What is the exact text of the exception you are getting? -----Original Message----- From: Bob Uva [mailto:Bob.Uva@;SAS.COM] Sent: Monday, November 11, 2002 5:30 PM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] COM+ object method called from C# We've got a lot of COM+ objects that were developed in VB and which can be happily called from C# assemblies outside of COM+. I've got a problem where an exception is thrown indicating that a method cannot be found. The IL shows that the method is to be called, and I've confirmed that the method exists in the COM+ package. All GUIDs look ok (ie, Component Services listings match what I see through OleView). Following is the beginning of the IL for the C# method (SaveModelOptions) that makes a call on the COM+ object db_Models.ModelsClass's GetModelInfo method. .method public hidebysig instance void SaveModelOptions() cil managed { // Code size 187 (0xbb) .maxstack 5 .locals init ([0] class [Interop.db_Models]db_Models.ModelsClass oModels, [1] class [ADODB]ADODB.Recordset rsModel, Does anyone have any ideas? Thanks, Bob -----Original Message----- From: Chad Yost [mailto:cyost@;CHARTER.NET] Sent: Wednesday, October 02, 2002 11:07 AM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Before I ask my questions, here is a little background on our application. We have a large Web Application written in VBScript that talk to a COM based middle tier that communicates with (non-SQL) legacy data. One of the requirements of the middle tier is that when a user logs on to the system, a new process needs to be started. This process is where all the COM objects reside. This is accomplished by creating an LOCAL_SERVER object (webstate) that resides in the EXE and is marked with REGCLS_SINGLEUSE (causing a new EXE to be created whenever the object is instantiated). This webstate object has methods to create other objects via progid (as Server.CreateObject does). This is all necessary because the company I work for would loses large amounts of revenue when a user is dropped from the system, and we don't want one user who did something that caused our code to crash to effect another user on the system. We are also not using the state management built into ASP, since we need custom functionality that it does not support. Now we are in the process of porting portions of the COM middle tier to C#, and portions of the ASP to ASP.NET with C# and need to allow this requirement to continue... 1) Is there a way to create a .NET object remotely that will start a new AppDomain in a new Process, create the object in that process, and create the proxy (as in the REGCLS_SINGLEUSE attribute for local com servers)? I have tried to remove the requirement of a separate process by trying to explain AppDomains, but to no avail. 2) If not, can we get the Default AppDomain from a process? I can easily create a new process using the System.Diagnostics.Process class, have the process Bind with the CLR to create an AppDomain, but how do I get either get the remote AppDomain in ASP.NET, or create an object in the Default AppDomain of the newly created process... 3) Is there, without removing this requirement, to do the same thing. Reminder, this info is per *user*, not per *request* or per *web application* and therefore things like IIS process isolation, Web Gardens, etc. don't fit the bill. Thanks in advance Chad Yost You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.
