AppDomain.AssemblyResolve not firing for web serv.

J

Joel Plofsky

I am using the web service behavior htc to hit a web method contained
within a asmx file of my solution. If the asmx file is part of my
start-up project the web service request is successful. However, if
the asmx file is part of another project, the web service request is
unsuccessful.

The Global.Application_BeginRequest method is called, at which time I
subscribe to the AppDomain.AssemblyResolve event with the following
lines.

AppDomain objDomain = AppDomain.CurrentDomain;
objDomain.AssemblyResolve += new
ResolveEventHandler(OnResolveAssembly);

OnResolveAssembly is used to figure out the proper assembly and return
it. However, it is never called during the web service request.

I end up getting a "Cannot load type" error.
 
D

Dave

Perhaps you could try hooking the TypeResolve event.

Does Fuslogvw.eve show any errors?
 
J

Joel Plofsky

Thanks for your suggestions. Fuslogvw.exe was helpful. Turned out I
needed to add an Assembly tag to my .asmx file.

<%@ Assembly Name="MyWebService" %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top