2

I am experiencing a random issue with the SCSF 2010 guidance package when I try to add a View with Presenter in my VS2010 project. This also happens when I try to add a Business Module as well.

The issue seems to happen randomly because the same exact solution opened in two different locations, one will let me add views and the other one will throw the exception. Its really mind boggling. Sometimes it will let me add Views no problem, sometimes it just crashes.

I have to check out an earlier version of my solution from source (which I know will let me add views) and create everything and import it into the most current version.

It seems to be related to this WCSF issue but I had no luck with the solutions proposed here.

http://webclientguidance.codeplex.com/discussions/263101

Deleting the gpState and re-enabling SCSF did not help.

This is the error:

Microsoft.Practices.WizardFramework.WizardExecutionException: The wizard failed to execute. The error was: Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider'. ---> System.InvalidCastException: Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider'.

neverseenjack
  • 316
  • 2
  • 13
  • Have you ever found a way to solve this? I'm getting the same error. – GendoIkari Oct 10 '12 at 17:18
  • @GendoIkari, please take a look at my answer and let me know if it works for you too. Thanks! – Mike Perrenoud Oct 16 '12 at 17:48
  • I have not found a way to solve this yet. I currently have to have an earlier version of my SCSF project where the Guidance Package still works properly, which I use to create the new View+Presenter and then manually import it into my current version. Real pain in the @$$. – neverseenjack Oct 17 '12 at 20:55
  • It was working fine for me yesterday... just now I tried it and got the error. And when I get the error, VS freezes and I have to force-quit. – GendoIkari Oct 18 '12 at 15:17

2 Answers2

0

I believe this is the answer to your problem.

The problem can be resolved by removing a Page Flow project and the Page Flow settings in web.config (including connection string and http modules).

Which you can find here.

Mike Perrenoud
  • 66,820
  • 29
  • 157
  • 232
  • It's not clear where exactly it's saying this Page Flow reference is... I can't find anything like that in my solution. I'm not sure how to actually test the fix... the problem seems to randomly go away on it's own from time to time. I had it working fine a couple days ago. Then today I tried to add a view and it crashed. I had to force-quit VS, and after I restarted it, I could add a view just fine. – GendoIkari Oct 16 '12 at 18:19
  • @GendoIkari, here is another comment on it from that link `FYI: This solution worked for me as well. I had to remove the page flow project restart Visual Studio, add the view, and then add the page flow project back.` Does that ring a bell or no? – Mike Perrenoud Oct 16 '12 at 18:24
  • I don't have a Page Flow project... I think that link is talking about a different error; I'm getting "Unable to cast object of type" exception, while that link is talking about a "calling the value provider or evaluating the default value of argument ModuleInfos" exception... – GendoIkari Oct 16 '12 at 18:35
  • @GendoIkari, sorry about that. – Mike Perrenoud Oct 16 '12 at 18:41
  • I don't have a web.config and I looked for the Page Flow inside my app.config file and it had no such entry. The answer you gave is related to the Web Client Software Factory(WCSF), my question relates to the Smart Client Software Factory (SCSF) which is strictly Winforms. – neverseenjack Oct 17 '12 at 20:52
  • @neverseenjack, my apologies. – Mike Perrenoud Oct 18 '12 at 10:30
0

Recipe Framework Error when adding page with presenter.

... some users have also suggested that deleting the .gpState file of the solution, re-opening the visual studio & solution and re-enabling WCSF Guidance seems to fix this problem temporarily. Please, create a backup of your .gpState file before trying this approach.

John Isaiah Carmona
  • 5,260
  • 10
  • 45
  • 79
  • Hey John, thanks for your answer. I tried doing this before but it did not solve the problem. – neverseenjack Oct 17 '12 at 20:52
  • Yeah, just tried that also... no help. Currently the situation seems to have gone from "first time VS crashes; after force-quit and restart it works" to "VS crashes every time." I guess I can just add all the files manually and copy the generated code from one of the other views.... – GendoIkari Oct 22 '12 at 18:10
  • I can't say if this was just a coincidence or not, but after I force-quit VS, I tried deleting the .suo file. When I re-opened it, I was able to add the view! – GendoIkari Oct 22 '12 at 19:22