hi,
I have created a com+ object in a computer and I have exported this com+
object to another computer. before I have tried to use this com+ object in
a console application. t just worked if I had created com+ objects with
marshal.BindToMoniker. but although I have used same code in web application,
it does not work.
name of the com+ object is serkanCom
code is below

---------

private void Button4_Click(object sender, System.EventArgs e)
{
serkanCom.IserkanCom c=(serkanCom.IserkanCom)Marshal.BindToMoniker
("new:serkanCom.serkanCom");

string str_id=TextBox1.Text.ToString();
int id=Convert.ToInt32(str_id,10);
string name=TextBox2.Text.ToString();
string dept=TextBox3.Text.ToString();
int k=c.addRec(id,name,dept);

}

the error is
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error: Line 92: {
Line 93:
Line 94: serkanCom.IserkanCom c=(serkanCom.IserkanCom)Marshal.BindToMoniker("new:serkanCom.serkanCom");
Line 95: //serkanCom.serkanCom c=new serkanCom.serkanCom();
Line 96:

Stack Trace:


[InvalidCastException: Specified cast is not valid.]
appclients.WebForm1.Button4_Click(Object sender, EventArgs e) in c:\inetpub\zeugmaweb\appclients\clients.aspx.cs:94
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(St ring
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263


-------------------------------------


if I try to create object like
serkanCom.serkanCom c=new serkanCom.serkanCom();
this time error is the
Server Error in '/appclients' Application.
--------------------------------------------------------------------------------

Access to the registry key HKEY_CLASSES_ROOT\serkanCom.serkanCom is denied.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the registry
key HKEY_CLASSES_ROOT\serkanCom.serkanCom is denied.

The ASP.NET process is not authorized to access the requested resource. For
security reasons the default ASP.NET process identity is '{machinename}\ASPNET',
which has limited privileges. Consider granting access rights to the resource
to the ASP.NET process identity.

To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET"
user. Highlight the ASP.NET account, and check the Write box in the Allow
column.

Source Error:


Line 93:
Line 94: //serkanCom.IserkanCom c=(serkanCom.IserkanCom)Marshal.BindToMoniker("new:serkanCom.serkanCom");
Line 95: serkanCom.serkanCom c=new serkanCom.serkanCom();
Line 96:
Line 97:


Source File: c:\inetpub\zeugmaweb\appclients\clients.aspx.cs Line: 95


Stack Trace:


[UnauthorizedAccessException: Access to the registry key HKEY_CLASSES_ROOT\serkanCom.serkanCom
is denied.]
Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) +74
Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) +503
System.Runtime.InteropServices.RegistrationServices.RegisterManagedType(Type
type, String strAsmName, String strAsmCodeBase) +215
System.Runtime.InteropServices.RegistrationServices.RegisterAssembly(Assembly
assembly, AssemblyRegistrationFlags flags) +171
System.EnterpriseServices.RegistrationDriver.ClassicRegistration(Assembly
asm) +99

[RegistrationException: Failed to register assembly 'serkanCom, Version=1.0.971.18322,
Culture=neutral, PublicKeyToken=1a8d1ca9b7450edd'.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,
Int32 type) +692
System.EnterpriseServices.RegistrationHelperTx.InstallAssembly(String
assembly, String& application, String partition, String& tlb, InstallationFlags
installFlags, Object sync) +0
System.EnterpriseServices.RegistrationHelper.TryTransactedInstall(String
assembly, String& application, String partition, String& tlb, InstallationFlags
installFlags) +228
System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly,
String& application, String partition, String& tlb, InstallationFlags installFlags)
+280
System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly,
String& application, String& tlb, InstallationFlags installFlags) +19
System.EnterpriseServices.RegistrationHelper.System.EnterpriseServices.Thunk.IThunkInstall ation.DefaultInstall(String
asm) +43
System.EnterpriseServices.Thunk.Proxy.RegisterAssembly(Assembly assembly)
+95
System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType,
Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri) +296
System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type
serverType) +181
System.Runtime.Remoting.Activation.ActivationServices.CreateInstanceWithLinkDemand(ProxyAt tribute
pa, Type serverType) +4
System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type
serverType, Object[] props) +122
appclients.WebForm1.Button4_Click(Object sender, EventArgs e) in c:\inetpub\zeugmaweb\appclients\clients.aspx.cs:95
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(St ring
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263


f someone will help I will be very glad...
thanks