WebClientApplication null value error

Topics: Web Client Software Factory
May 3, 2007 at 6:29 PM
I recently installed the lastest version of the Web Client Software Factory, and upon completing the initial "recipe," I got an error resulting from a null reference to context.Handler in the code example (altered to correct the error) below:

protected void InnerPostRequestHandlerExecute(IHttpContext context)
{
if (HttpRequestHelper.IsHandledByPageHandlerFactory(context.Request.Url.ToString()))
{
ICompositionContainer moduleContainer = GetModuleContainer(context);
// added by travis 05/03/2007: check to assure context.Handler is not null...
if (moduleContainer != null && context.Handler != null)
{
PageBuilder.TearDown<IHttpHandler>(moduleContainer.Locator, context.Handler);
}
// end modification
}

if (context.Handler is Page)
{
PostPageExecute(context.Handler as Page);
}
}

The above code allows the application to run. I added a check to assure that context.Handler is not null, but I was unsure if this could lead to any side effects. Was this the correct thing to do to fix the null reference error I was getting?

Thanks in advance.
Coordinator
May 7, 2007 at 8:36 PM
Hi,
Could you explain a little further? what url are you requesting when you get the exception?
Any additional info to reproduce the error would be appreciated.

Thanks,
Julián Domínguez
http://staff.southworks.net/blogs/jdominguez
May 14, 2007 at 4:33 PM
When I install the latest available Guidance Automation Extensions, followed by the latest Guidance Automation Toolkit and the current Web Client Software Factory on a fresh machine configured with Visual Studio 2005 SP1 with Vista Update (Vista Ultimate O/S), I simply create a new WCSF project in any directory without making any alterations.

Debugging the project from there produces the "null value error" that I describe above.


juliandominguez wrote:
Hi,
Could you explain a little further? what url are you requesting when you get the exception?
Any additional info to reproduce the error would be appreciated.

Thanks,
Julián Domínguez
http://staff.southworks.net/blogs/jdominguez