Thanks for your response, Atif.
I'm trying to add this to an existing
ASP.NET 1.1 app using
VB.NET.
I'm not too familiar with c# and am having issues converting this. I
tried to convert this code using a couple of online c# to
vb.net
conversion tools, but they both failed.
I haven't had to deal with event delegates and IServiceProvider
before, so there's quite a bit new here for me. My limited c#
knowledge isn't helping, either.
Where to start. OK, the CreateServiceProviderQueryHandler method in
the example you supplied accepts a single parameter typed as
IServiceProvider. As per your example, I tried the following
(converted to
vb.net):
Elmah.ServiceCenter.Current =
CreateServiceProviderQueryHandler(Elmah.ServiceCenter.Current)
This gives me the following design time error:
Option Strict On disallows implicit conversions from
'Elmah.ServiceProviderQueryHandler' to 'System.IServiceProvider'.
So I tried this:
Elmah.ServiceCenter.Current =
CreateServiceProviderQueryHandler(CType(Elmah.ServiceCenter.Current,
IServiceProvider))
This resolves the design time error, but now I get the following run
time error:
Specified cast is not valid.
The other issue I'm having is with this: "return context => {". I'm
not sure what the
vb.net equivalent is. I also think this is what's
causing the c# to
vb.net converters to fail.
I can't remember the last time I've felt so confused by such a small
amount of code. I've since done some reading on delegate functions and
have googled c# method context, but I can't seem to get a handle on
this. I would appreciate any additional help you could give.
Thanks,
Tim
P.S. I see that you replied the same day that I responded and I
apologize for not responding sooner. I've checked back a few times and
today is the first time it actually showed a response. I clear my
browser temp files on a regular basis, so it can't be a cache issue.
Weird.
> [1]
http://msdn.microsoft.com/en-us/library/system.componentmodel.design....