Queued Component issue with Windows Server 2003 -
09-27-2004
, 05:39 AM
Hello!
I have made a simple queued component with C# .NET (source code below). But
when I try to run it I get an error message in the eventlog (see below).
The messages end up in the dead queue in MSMQ. The target computer is a
Windows 2003 Server. When I run the same program on my Windows XP-machine
everything works just fine.
I register my program with regsvcs and start it with Right-Click-Start in
COM+. The user account that runs the COM+-program has full rights to the
public MSMQ-queue and the private ones.
I'm running out of time and ideas. Any help would be very appreciated.
Best regards
Niclas Forsell
===== Error Message ================================
Event Type: Error
Event Source: COM+
Event Category: (103)
Event ID: 4772
Date: 2004-09-14
Time: 14:01:47
User: N/A
Computer: W2003SERVER
Description:
The COM+ Queued Components Player was unable to create an instance of a
Queued Component. CPlayer BindToObject
Server Application ID: {C9F73B3C-330C-4D3A-AE08-5419F51F02D1}
Server Application Instance ID:
{57AD0446-3FBA-4880-AF53-F342C36B9C7F}
Server Application Name: QComponent
Error Code = 0x80070002 : The system cannot find the file specified.
COM+ Services Internals Information:
File: d:\nt\com\complus\src\comsvcs\qc\player\player.cpp , Line: 467
Comsvcs.dll file version: ENU 2001.12.4720.130 shp
===== QComponent.cs =================================
using System;
using System.EnterpriseServices;
using System.IO;
namespace QCDemo
{
public interface IQComponent
{
void Log(string logMe);
void Dispose();
}
[InterfaceQueuing(Interface = "IQComponent"),
EventTrackingEnabled(true)]
public class QComponent : ServicedComponent, IQComponent
{
public QComponent()
{
}
public void Log(string logMe)
{
StreamWriter sw = new
StreamWriter("c:\\q.txt",true);
sw.WriteLine(logMe);
sw.Close();
}
}
}
===== Assemblyinfo.cs (for QComponent) =================
[assembly: ApplicationName("QComponent")]
[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ApplicationQueuing(Enabled=true, QueueListenerEnabled=true)]
....
[assembly: AssemblyKeyFile("..\\..\\key.snk")]
....
===== Test program =====================================
private void button1_Click(object sender, System.EventArgs e)
{
IQComponent q = null;
try
{
q =
(IQComponent)Marshal.BindToMoniker("queue:/new:QCDemo.QComponent");
}
catch
{
MessageBox.Show("Error! Doesn't compute!");
}
q.Log("Text to log");
q.Dispose();
Marshal.ReleaseComObject(q);
} |