2

Closed

Page Flow Error in Visual Studio 2008

description

While doing the WCSF Hands On Labs with the Page Flow recipe in Visual Studio 2008 I am receiving the following Error:
 
"Invalid type owner for DynamicMethod.
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.ArgumentException: Invalid type owner for DynamicMethod."
 
I am developing under Windows XP using the Web Client Solution (C#, WAP).
 
Labs 1-7 work fine, Lab 8 fails when trying to go through the page flow (i.e. Login and then click on the EFT module which uses page flow).
 
All pageflow config values in the webconfig have been changed to point to the contrib pageflow assemblies.
 
I've attached my project files.
 
Below is the stacktrace of the error:
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
 
[ArgumentException: Invalid type owner for DynamicMethod.]
System.Reflection.Emit.DynamicMethod.Init(String name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] signature, Type owner, Module m, Boolean skipVisibility, Boolean transparentMethod) +1679307
System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner) +64
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.DynamicMethodPlan.DynamicMethodPlanBuilderPolicy.CreatePlan(Type typeToBuild, String idToBuild) +283
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.BuildPlanStrategy.GetPlanFromContext(IBuilderContext context, Type typeToBuild, String idToBuild) +148
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.BuildPlanStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +60
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.ObjectBuilder.Strategies.SimplifiedSingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +229
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.ObjectBuilder.TypeMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +457
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.BuilderStrategies.ContainerAwareTypeMappingStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +266
BuildUp_GlobalBankWAP.EFT.EFTController(IBuilderContext , Type , Object , String ) +279
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.DynamicMethodPlan.DynamicMethodBuildPlan.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String id) +66
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.BuildPlanStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +85
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.ObjectBuilder.Strategies.SimplifiedSingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +229
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.ObjectBuilder.TypeMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +457
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.BuilderStrategies.ContainerAwareTypeMappingStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +238
BuildUp_GlobalBankWAP.EFT.Views.LastTransferViewPresenter(IBuilderContext , Type , Object , String ) +85
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.DynamicMethodPlan.DynamicMethodBuildPlan.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String id) +66
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.BuildPlanStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +85
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.ObjectBuilder.Strategies.SimplifiedSingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +229
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.ObjectBuilder.TypeMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +457
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.BuilderStrategies.ContainerAwareTypeMappingStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +238
BuildUp_ASP.eft_lasttransferview_aspx(IBuilderContext , Type , Object , String ) +120
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.DynamicMethodPlan.DynamicMethodBuildPlan.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String id) +66
Microsoft.Practices.CompositeWeb.ObjectBuilder.BuildPlan.BuildPlanStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +85
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.ObjectBuilder.Strategies.SimplifiedSingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +229
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.ObjectBuilder.TypeMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +457
Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +63
Microsoft.Practices.CompositeWeb.BuilderStrategies.ContainerAwareTypeMappingStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +266
Microsoft.Practices.CompositeWeb.ObjectBuilder.WCSFBuilderBase1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +128
Microsoft.Practices.CompositeWeb.ObjectBuilder.WCSFBuilderBase
1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +63
Microsoft.Practices.CompositeWeb.CompositionContainer.BuildItem(IBuilder`1 builder, IReadWriteLocator locator, Object item) +348
Microsoft.Practices.CompositeWeb.WebClientApplication.BuildItemWithCurrentContext(Object obj) +157
Microsoft.Practices.CompositeWeb.Web.UI.Page.OnPreInit(EventArgs e) +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +663
 

 

 

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

file attachments

Closed May 14, 2008 at 9:12 PM by jonathan
This issue is related to Web Client Software Factory February 2008 and it is not an issue directly related to Page Flow Application Block.

For more information see: http://www.codeplex.com/wcsfcontrib/WorkItem/View.aspx?WorkItemId=10194

comments

bschwehn wrote May 13, 2008 at 2:47 PM

The Code:



[ProviderDependency(typeof(PageFlowDirectory))]
public IPageFlowProvider PageFlowProvider
{
get {
if (_pageFlowProvider == null) {
}
_pageFlowProvider PageFlowDirectory.Provider
return _pageFlowProvider;
}
set { _pageFlowProvider = value; }
}

In the Quickstarts is wrong (for the current release at least) and cannot work. PageFlowDirectory being a static class that doesn't implement IPageFlowProvider is the problem I guess.

To fix the exception you can just remove the whole property and replace

if (_transferPageFlow == null)
{
_transferPageFlow = _pageFlowProvider.GetPageFlow(typeof(TransferPageFlow));


with

if (_transferPageFlow == null)
{
_transferPageFlow = PageFlowDirectory.Provider.GetPageFlow(typeof(TransferPageFlow));


HTH anyone
Benjamin Schwehn

wrote May 14, 2008 at 9:12 PM

Jopo wrote May 14, 2008 at 9:45 PM

Thanks so much for your solution!

Tried it out and now everything works fine.

MVC2008 wrote Jan 12, 2009 at 8:11 PM

Hi,

I followed the instructions provided, however I still having the same error... I recompile the CompositeWeb Project to use Enterprise Lib 4.1 , I don't know if that make a difference. Please let me know if I am missing something

Thanks

wrote Feb 13, 2013 at 10:14 PM

wrote May 16, 2013 at 1:44 AM