By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Unable to install .Net Assembly in Windows 2003 Web Edition.

P: n/a
I have a ASP.Net web application that has two assemblies that run
under com+. Under Windows 2000 the two assemblies are added to com+
automatically when instantiated from the web site. For this to happen
we had to change the context in which asp.net runs from machine to
SYSTEM by modifying the machine.config file. Under Windows 2003 no
matter how asp.net is set to run as either machine or system. I get
the following error:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

and this stack trace.

ReflectionTypeLoadException: One or more of the types in the assembly
unable to load.]
System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type) +877
System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(RegistrationConfig&
regConfig, Object sync) +0

System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(RegistrationConfig
regConfig) +215
System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(RegistrationConfig&
regConfig) +241
System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags) +116

System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String& tlb, InstallationFlags
installFlags) +19

System.EnterpriseServices.RegistrationHelper.Syste m.EnterpriseServices.Thunk.IThunkInstallation.Defa ultInstall(String
asm) +43

System.EnterpriseServices.Thunk.Proxy.RegisterAsse mbly(Assembly
assembly) +95
System.EnterpriseServices.Thunk.Proxy.LazyRegister (Guid id, Type
serverType, Boolean checkCache) +188
System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
uri) +227

System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Type
serverType) +181
System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Type
serverType, Object[] props, Boolean bNewObj) +74

ExtendAg.Web.Utilities.LoginUtils._getContextXml(S tring userId,
String password, TraceLevel tracingLevel, String supportedCulture,
String sessionId) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs:55

ExtendAg.Web.Utilities.LoginUtils.GetContext(Strin g userId, String
password, TraceLevel tracingLevel, String supportedCulture, String
sessionId, Boolean& bAcceptedEula, Boolean& bPasswordReset, Boolean&
bIsExtendAgAccount) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs:78

ExtendAg.Web.Utilities.LoginUtils.Authenticate(Str ing userId,
String password, HttpSessionState s, String filePath, TraceLevel
tracingLevel, String supportedCulture) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs:113

ExtendAg.Web.Public.Controls.SignIn.SigninBtn_Clic k(Object sender,
EventArgs e) in C:\Projects\extendag\SourceCode2\Web\ExtendAgWeb\P ublic\Controls\SignIn.ascx.cs:142

System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57

System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+138
System.Web.UI.Page.ProcessRequestMain() +1277

The next thing I tried to do was to add the assemblies to com+
manually. I did this two different ways. The first was to use the
com+ mmc and create a new application and then add the components.
One of the assemblies install just fine, but the second one which is
called datalayer.dll gives me this error:

An error occurred while processing the last operation.
Error code 80131602.
The event log may contain additional troubleshooting information.

Event log has the following message:

Installation of 'C:\Xag\ExtendAgWeb\bin\DataLayer.dll' into
'{03264527-2A73-49FE-BAEF-0EBAE663E01F}' failed with an exception:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

Server stack trace:
at System.Reflection.Module.GetTypesInternal(StackCra wlMark&
stackMark)
at System.Reflection.Assembly.GetTypes()
at System.EnterpriseServices.RegistrationDriver.Check AssemblySCValidity(Assembly
asm)
at System.EnterpriseServices.RegistrationDriver.NewLo adAssembly(String
assembly)
at System.EnterpriseServices.RegistrationDriver.Insta llAssembly(RegistrationConfig
regConfig, Object obSync)
at System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(RegistrationConfig&
regConfig, Object sync)

at System.Runtime.Remoting.Messaging.Message.Dispatch (Object
target, Boolean fExecuteInContext)
at System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type)
at System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(RegistrationConfig&
regConfig, Object sync)

at System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(RegistrationConfig
regConfig)
at System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(RegistrationConfig&
regConfig)
at System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags)

at System.EnterpriseServices.Internal.ComManagedImpor tUtil.InstallAssembly(String
asmpath, String parname, String appname)

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

The second way I tried to add the components to com+ was by using
regsvcs.exe. I used the following command:

regsvcs /appname:ExtendAg datalayer.dll.

Which returns the following error.

An unknown exception occurred during installation:
1: System.Runtime.Serialization.SerializationExceptio n - Insufficient
state to deserialize the object. More information is needed.

I installed Visual Studio .Net 2003 and I am able to build
datalayer.dll. I tried using this dll and got the same exact results
as above. The error messages purports that there is an assembly it
cannot find, I have gone through the dependencies for datalayer.dll
and all required assemblies are installed. I have also used ntfilemon
and ntregmon to monitor activity and see if there was something
missing or permission problem. I found nothing out of the ordinary.
However, when I try to access the app and get the error message:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

If I hit F5 and repost the data I get

System.UnauthorizedAccessException: Access to the registry key
HKEY_CLASSES_ROOT\ExtendAg.Objects.HashtableRequir ed is denied.

with this stack trace.

UnauthorizedAccessException: Access to the registry key
HKEY_CLASSES_ROOT\ExtendAg.Objects.HashtableRequir ed is denied.]

Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
+74
Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) +503
System.Runtime.InteropServices.RegistrationService s.RegisterManagedType(Type
type, String strAsmName, String strAsmVersion, String strAsmCodeBase,
String strRuntimeVersion) +213

System.Runtime.InteropServices.RegistrationService s.RegisterAssembly(Assembly
assembly, AssemblyRegistrationFlags flags) +261

System.EnterpriseServices.RegistrationDriver.Class icRegistration(Assembly
asm) +100

[RegistrationException: Failed to register assembly 'DataLayer,
Version=1.1.1402.28709, Culture=neutral,
PublicKeyToken=70025df6990ea3c3'.]

System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type) +877
System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(RegistrationConfig&
regConfig, Object sync) +0

System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(RegistrationConfig
regConfig) +215
System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(RegistrationConfig&
regConfig) +241
System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags) +116

System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String& tlb, InstallationFlags
installFlags) +19

System.EnterpriseServices.RegistrationHelper.Syste m.EnterpriseServices.Thunk.IThunkInstallation.Defa ultInstall(String
asm) +43

System.EnterpriseServices.Thunk.Proxy.RegisterAsse mbly(Assembly
assembly) +95
System.EnterpriseServices.Thunk.Proxy.LazyRegister (Guid id, Type
serverType, Boolean checkCache) +188
System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
uri) +227

System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Type
serverType) +181
System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Type
serverType, Object[] props, Boolean bNewObj) +74

ExtendAg.Web.Utilities.LoginUtils._getContextXml(S tring userId,
String password, TraceLevel tracingLevel, String supportedCulture,
String sessionId) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs:55

ExtendAg.Web.Utilities.LoginUtils.GetContext(Strin g userId, String
password, TraceLevel tracingLevel, String supportedCulture, String
sessionId, Boolean& bAcceptedEula, Boolean& bPasswordReset, Boolean&
bIsExtendAgAccount) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs:78

ExtendAg.Web.Utilities.LoginUtils.Authenticate(Str ing userId,
String password, HttpSessionState s, String filePath, TraceLevel
tracingLevel, String supportedCulture) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs:113

ExtendAg.Web.Public.Controls.SignIn.SigninBtn_Clic k(Object sender,
EventArgs e) in C:\Projects\extendag\SourceCode2\Web\ExtendAgWeb\P ublic\Controls\SignIn.ascx.cs:142

System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +58

System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+138
System.Web.UI.Page.ProcessRequestMain() +1277

This is the error message we got under windows 2000 and the asp.net
was set to run as machine instead of system. However, as I've stated
before changing this in windows 2003 makes no difference.

If someone out there has come across this or can help me figure it out
I would be much obliged. Thanks.
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The stack trace indicates the app is trying to auto-register your COM+ app.
This requires admin rights on the machine which ASP.NET does not (should
not) have, regardless whether you run as machine or system.
You should manually install the COM+ app (serviced component), probably
using regsvcs.exe .

Auto-registration of serviced components into COM+ is primarily a
convenience feature for devevelopment time.
For more on this, check out
http://msdn.microsoft.com/library/en...ml/entserv.asp
particularly the section on Deployment.

-Dino
"Carlos G Benevides" <tr********@hotmail.com> wrote in message
news:a1**************************@posting.google.c om...
I have a ASP.Net web application that has two assemblies that run
under com+. Under Windows 2000 the two assemblies are added to com+
automatically when instantiated from the web site. For this to happen
we had to change the context in which asp.net runs from machine to
SYSTEM by modifying the machine.config file. Under Windows 2003 no
matter how asp.net is set to run as either machine or system. I get
the following error:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

and this stack trace.

ReflectionTypeLoadException: One or more of the types in the assembly
unable to load.]
System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type) +877
System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig& regConfig, Object sync) +0

System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(Registrati
onConfig regConfig) +215
System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(Regis
trationConfig& regConfig) +241
System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags) +116

System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String& tlb, InstallationFlags
installFlags) +19

System.EnterpriseServices.RegistrationHelper.Syste m.EnterpriseServices.Thunk
..IThunkInstallation.DefaultInstall(String asm) +43

System.EnterpriseServices.Thunk.Proxy.RegisterAsse mbly(Assembly
assembly) +95
System.EnterpriseServices.Thunk.Proxy.LazyRegister (Guid id, Type
serverType, Boolean checkCache) +188
System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
uri) +227

System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Typ
e serverType) +181
System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Typ
e serverType, Object[] props, Boolean bNewObj) +74

ExtendAg.Web.Utilities.LoginUtils._getContextXml(S tring userId,
String password, TraceLevel tracingLevel, String supportedCulture,
String sessionId) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:55
ExtendAg.Web.Utilities.LoginUtils.GetContext(Strin g userId, String
password, TraceLevel tracingLevel, String supportedCulture, String
sessionId, Boolean& bAcceptedEula, Boolean& bPasswordReset, Boolean&
bIsExtendAgAccount) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:78
ExtendAg.Web.Utilities.LoginUtils.Authenticate(Str ing userId,
String password, HttpSessionState s, String filePath, TraceLevel
tracingLevel, String supportedCulture) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:113
ExtendAg.Web.Public.Controls.SignIn.SigninBtn_Clic k(Object sender,
EventArgs e) in C:\Projects\extendag\SourceCode2\Web\ExtendAgWeb\P ublic\Controls\SignIn.ascx
..cs:142
System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.Rai
sePostBackEvent(String eventArgument) +57

System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+138
System.Web.UI.Page.ProcessRequestMain() +1277

The next thing I tried to do was to add the assemblies to com+
manually. I did this two different ways. The first was to use the
com+ mmc and create a new application and then add the components.
One of the assemblies install just fine, but the second one which is
called datalayer.dll gives me this error:

An error occurred while processing the last operation.
Error code 80131602.
The event log may contain additional troubleshooting information.

Event log has the following message:

Installation of 'C:\Xag\ExtendAgWeb\bin\DataLayer.dll' into
'{03264527-2A73-49FE-BAEF-0EBAE663E01F}' failed with an exception:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

Server stack trace:
at System.Reflection.Module.GetTypesInternal(StackCra wlMark&
stackMark)
at System.Reflection.Assembly.GetTypes()
at System.EnterpriseServices.RegistrationDriver.Check AssemblySCValidity(Assembl
y asm)
at System.EnterpriseServices.RegistrationDriver.NewLo adAssembly(String
assembly)
at System.EnterpriseServices.RegistrationDriver.Insta llAssembly(RegistrationCon
fig regConfig, Object obSync)
at System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig& regConfig, Object sync)

at System.Runtime.Remoting.Messaging.Message.Dispatch (Object
target, Boolean fExecuteInContext)
at System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessa
ge msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type)
at System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig& regConfig, Object sync)

at System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(Registrati
onConfig regConfig)
at System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(Regis
trationConfig& regConfig)
at System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags)

at System.EnterpriseServices.Internal.ComManagedImpor tUtil.InstallAssembly(Stri
ng asmpath, String parname, String appname)

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

The second way I tried to add the components to com+ was by using
regsvcs.exe. I used the following command:

regsvcs /appname:ExtendAg datalayer.dll.

Which returns the following error.

An unknown exception occurred during installation:
1: System.Runtime.Serialization.SerializationExceptio n - Insufficient
state to deserialize the object. More information is needed.

I installed Visual Studio .Net 2003 and I am able to build
datalayer.dll. I tried using this dll and got the same exact results
as above. The error messages purports that there is an assembly it
cannot find, I have gone through the dependencies for datalayer.dll
and all required assemblies are installed. I have also used ntfilemon
and ntregmon to monitor activity and see if there was something
missing or permission problem. I found nothing out of the ordinary.
However, when I try to access the app and get the error message:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

If I hit F5 and repost the data I get

System.UnauthorizedAccessException: Access to the registry key
HKEY_CLASSES_ROOT\ExtendAg.Objects.HashtableRequir ed is denied.

with this stack trace.

UnauthorizedAccessException: Access to the registry key
HKEY_CLASSES_ROOT\ExtendAg.Objects.HashtableRequir ed is denied.]

Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
+74
Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) +503
System.Runtime.InteropServices.RegistrationService s.RegisterManagedType(Type type, String strAsmName, String strAsmVersion, String strAsmCodeBase,
String strRuntimeVersion) +213

System.Runtime.InteropServices.RegistrationService s.RegisterAssembly(Assembl
y assembly, AssemblyRegistrationFlags flags) +261

System.EnterpriseServices.RegistrationDriver.Class icRegistration(Assembly asm) +100

[RegistrationException: Failed to register assembly 'DataLayer,
Version=1.1.1402.28709, Culture=neutral,
PublicKeyToken=70025df6990ea3c3'.]

System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type) +877
System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig& regConfig, Object sync) +0

System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(Registrati
onConfig regConfig) +215
System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(Regis
trationConfig& regConfig) +241
System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags) +116

System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String& tlb, InstallationFlags
installFlags) +19

System.EnterpriseServices.RegistrationHelper.Syste m.EnterpriseServices.Thunk
..IThunkInstallation.DefaultInstall(String asm) +43

System.EnterpriseServices.Thunk.Proxy.RegisterAsse mbly(Assembly
assembly) +95
System.EnterpriseServices.Thunk.Proxy.LazyRegister (Guid id, Type
serverType, Boolean checkCache) +188
System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
uri) +227

System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Typ
e serverType) +181
System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Typ
e serverType, Object[] props, Boolean bNewObj) +74

ExtendAg.Web.Utilities.LoginUtils._getContextXml(S tring userId,
String password, TraceLevel tracingLevel, String supportedCulture,
String sessionId) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:55
ExtendAg.Web.Utilities.LoginUtils.GetContext(Strin g userId, String
password, TraceLevel tracingLevel, String supportedCulture, String
sessionId, Boolean& bAcceptedEula, Boolean& bPasswordReset, Boolean&
bIsExtendAgAccount) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:78
ExtendAg.Web.Utilities.LoginUtils.Authenticate(Str ing userId,
String password, HttpSessionState s, String filePath, TraceLevel
tracingLevel, String supportedCulture) in
C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:113
ExtendAg.Web.Public.Controls.SignIn.SigninBtn_Clic k(Object sender,
EventArgs e) in C:\Projects\extendag\SourceCode2\Web\ExtendAgWeb\P ublic\Controls\SignIn.ascx
..cs:142
System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.Rai
sePostBackEvent(String eventArgument) +58

System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+138
System.Web.UI.Page.ProcessRequestMain() +1277

This is the error message we got under windows 2000 and the asp.net
was set to run as machine instead of system. However, as I've stated
before changing this in windows 2003 makes no difference.

If someone out there has come across this or can help me figure it out
I would be much obliged. Thanks.

Jul 21 '05 #2

P: n/a
Dino, if you keep reading my post you'll see that I have tried to
register the component manually using regsvcs and the com+ mmc.
However, it also does not work. I posted the stack trace from the web
application to explain how I got around this issue on Windows 2000. I
posted the stack trace from the command line regsvcs as well as the
mmc error message. You'll see that the message posted in eventviewer
is identical to the one output by the web app when trying to auto
register the component. The error messaged output by the regsvcs tool
is more ambiguous, and I am not sure it it's displaying the correct
error message.

If this is a permissions issue I would like to know how exactly I need
to register the component. Because I have tried all the means I know
how. Thanks.

"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message news:<eG**************@TK2MSFTNGP10.phx.gbl>...
The stack trace indicates the app is trying to auto-register your COM+ app.
This requires admin rights on the machine which ASP.NET does not (should
not) have, regardless whether you run as machine or system.
You should manually install the COM+ app (serviced component), probably
using regsvcs.exe .

Auto-registration of serviced components into COM+ is primarily a
convenience feature for devevelopment time.
For more on this, check out
http://msdn.microsoft.com/library/en...ml/entserv.asp
particularly the section on Deployment.

-Dino
"Carlos G Benevides" <tr********@hotmail.com> wrote in message
news:a1**************************@posting.google.c om...
I have a ASP.Net web application that has two assemblies that run
under com+. Under Windows 2000 the two assemblies are added to com+
automatically when instantiated from the web site. For this to happen
we had to change the context in which asp.net runs from machine to
SYSTEM by modifying the machine.config file. Under Windows 2003 no
matter how asp.net is set to run as either machine or system. I get
the following error:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

and this stack trace.

ReflectionTypeLoadException: One or more of the types in the assembly
unable to load.]
System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type) +877

System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig&
regConfig, Object sync) +0

System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(Registrati
onConfig
regConfig) +215

System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(Regis
trationConfig&
regConfig) +241
System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags) +116

System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String& tlb, InstallationFlags
installFlags) +19

System.EnterpriseServices.RegistrationHelper.Syste m.EnterpriseServices.Thunk
.IThunkInstallation.DefaultInstall(String
asm) +43

System.EnterpriseServices.Thunk.Proxy.RegisterAsse mbly(Assembly
assembly) +95
System.EnterpriseServices.Thunk.Proxy.LazyRegister (Guid id, Type
serverType, Boolean checkCache) +188
System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
uri) +227

System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Typ
e
serverType) +181

System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Typ
e
serverType, Object[] props, Boolean bNewObj) +74

ExtendAg.Web.Utilities.LoginUtils._getContextXml(S tring userId,
String password, TraceLevel tracingLevel, String supportedCulture,
String sessionId) in

C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:55

ExtendAg.Web.Utilities.LoginUtils.GetContext(Strin g userId, String
password, TraceLevel tracingLevel, String supportedCulture, String
sessionId, Boolean& bAcceptedEula, Boolean& bPasswordReset, Boolean&
bIsExtendAgAccount) in

C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:78

ExtendAg.Web.Utilities.LoginUtils.Authenticate(Str ing userId,
String password, HttpSessionState s, String filePath, TraceLevel
tracingLevel, String supportedCulture) in

C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:113

ExtendAg.Web.Public.Controls.SignIn.SigninBtn_Clic k(Object sender,
EventArgs e) in

C:\Projects\extendag\SourceCode2\Web\ExtendAgWeb\P ublic\Controls\SignIn.ascx
.cs:142

System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108

System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.Rai
sePostBackEvent(String
eventArgument) +57

System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+138
System.Web.UI.Page.ProcessRequestMain() +1277

The next thing I tried to do was to add the assemblies to com+
manually. I did this two different ways. The first was to use the
com+ mmc and create a new application and then add the components.
One of the assemblies install just fine, but the second one which is
called datalayer.dll gives me this error:

An error occurred while processing the last operation.
Error code 80131602.
The event log may contain additional troubleshooting information.

Event log has the following message:

Installation of 'C:\Xag\ExtendAgWeb\bin\DataLayer.dll' into
'{03264527-2A73-49FE-BAEF-0EBAE663E01F}' failed with an exception:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

Server stack trace:
at System.Reflection.Module.GetTypesInternal(StackCra wlMark&
stackMark)
at System.Reflection.Assembly.GetTypes()
at

System.EnterpriseServices.RegistrationDriver.Check AssemblySCValidity(Assembl
y
asm)
at System.EnterpriseServices.RegistrationDriver.NewLo adAssembly(String
assembly)
at

System.EnterpriseServices.RegistrationDriver.Insta llAssembly(RegistrationCon
fig
regConfig, Object obSync)
at

System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig&
regConfig, Object sync)

at System.Runtime.Remoting.Messaging.Message.Dispatch (Object
target, Boolean fExecuteInContext)
at

System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessa
ge
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
at

System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type)
at

System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig&
regConfig, Object sync)

at

System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(Registrati
onConfig
regConfig)
at

System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(Regis
trationConfig&
regConfig)
at System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags)

at

System.EnterpriseServices.Internal.ComManagedImpor tUtil.InstallAssembly(Stri
ng
asmpath, String parname, String appname)

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

The second way I tried to add the components to com+ was by using
regsvcs.exe. I used the following command:

regsvcs /appname:ExtendAg datalayer.dll.

Which returns the following error.

An unknown exception occurred during installation:
1: System.Runtime.Serialization.SerializationExceptio n - Insufficient
state to deserialize the object. More information is needed.

I installed Visual Studio .Net 2003 and I am able to build
datalayer.dll. I tried using this dll and got the same exact results
as above. The error messages purports that there is an assembly it
cannot find, I have gone through the dependencies for datalayer.dll
and all required assemblies are installed. I have also used ntfilemon
and ntregmon to monitor activity and see if there was something
missing or permission problem. I found nothing out of the ordinary.
However, when I try to access the app and get the error message:

System.Reflection.ReflectionTypeLoadException: One or more of the
types in the assembly unable to load.

If I hit F5 and repost the data I get

System.UnauthorizedAccessException: Access to the registry key
HKEY_CLASSES_ROOT\ExtendAg.Objects.HashtableRequir ed is denied.

with this stack trace.

UnauthorizedAccessException: Access to the registry key
HKEY_CLASSES_ROOT\ExtendAg.Objects.HashtableRequir ed is denied.]

Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
+74
Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) +503

System.Runtime.InteropServices.RegistrationService s.RegisterManagedType(Type
type, String strAsmName, String strAsmVersion, String strAsmCodeBase,
String strRuntimeVersion) +213

System.Runtime.InteropServices.RegistrationService s.RegisterAssembly(Assembl
y
assembly, AssemblyRegistrationFlags flags) +261

System.EnterpriseServices.RegistrationDriver.Class icRegistration(Assembly
asm) +100

[RegistrationException: Failed to register assembly 'DataLayer,
Version=1.1.1402.28709, Culture=neutral,
PublicKeyToken=70025df6990ea3c3'.]

System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg) +264
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type) +877

System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(Reg
istrationConfig&
regConfig, Object sync) +0

System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(Registrati
onConfig
regConfig) +215

System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(Regis
trationConfig&
regConfig) +241
System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String partition, String& tlb,
InstallationFlags installFlags) +116

System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
assembly, String& application, String& tlb, InstallationFlags
installFlags) +19

System.EnterpriseServices.RegistrationHelper.Syste m.EnterpriseServices.Thunk
.IThunkInstallation.DefaultInstall(String
asm) +43

System.EnterpriseServices.Thunk.Proxy.RegisterAsse mbly(Assembly
assembly) +95
System.EnterpriseServices.Thunk.Proxy.LazyRegister (Guid id, Type
serverType, Boolean checkCache) +188
System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type
serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
uri) +227

System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Typ
e
serverType) +181

System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Typ
e
serverType, Object[] props, Boolean bNewObj) +74

ExtendAg.Web.Utilities.LoginUtils._getContextXml(S tring userId,
String password, TraceLevel tracingLevel, String supportedCulture,
String sessionId) in

C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:55

ExtendAg.Web.Utilities.LoginUtils.GetContext(Strin g userId, String
password, TraceLevel tracingLevel, String supportedCulture, String
sessionId, Boolean& bAcceptedEula, Boolean& bPasswordReset, Boolean&
bIsExtendAgAccount) in

C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:78

ExtendAg.Web.Utilities.LoginUtils.Authenticate(Str ing userId,
String password, HttpSessionState s, String filePath, TraceLevel
tracingLevel, String supportedCulture) in

C:\Projects\EXTENDAG\SourceCode2\Web\ExtendAgWebCo mponents\src\LoginUtils.cs
:113

ExtendAg.Web.Public.Controls.SignIn.SigninBtn_Clic k(Object sender,
EventArgs e) in

C:\Projects\extendag\SourceCode2\Web\ExtendAgWeb\P ublic\Controls\SignIn.ascx
.cs:142

System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108

System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.Rai
sePostBackEvent(String
eventArgument) +58

System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+138
System.Web.UI.Page.ProcessRequestMain() +1277

This is the error message we got under windows 2000 and the asp.net
was set to run as machine instead of system. However, as I've stated
before changing this in windows 2003 makes no difference.

If someone out there has come across this or can help me figure it out
I would be much obliged. Thanks.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.