Wrox Programmer Forums
|
BOOK: Professional ASP.NET Design Patterns
This is the forum to discuss the Wrox book Professional ASP.NET Design Patterns by Scott Millett; ISBN: 978-0-470-29278-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2013, 04:32 PM
Registered User
 
Join Date: Jul 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default StructureMap Error Chapt8 MVP

Getting an error in Index.aspx.cs on this line...
Code:
_presenter = new HomePagePresenter(this, ObjectFactory.GetInstance<ProductService>());
Here is the error message...
{"StructureMap Exception Code: 202\nNo Default Instance defined for PluginFamily ASPPatterns.Chap8.MVP.Model.IProductRepository, ASPPatterns.Chap8.MVP.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"}

Any thoughts?

Thanks
Tim Tatum
 
Old February 1st, 2013, 02:59 AM
Registered User
 
Join Date: Jan 2013
Posts: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by timtatum View Post
Getting an error in Index.aspx.cs on this line...
Code:
_presenter = new HomePagePresenter(this, ObjectFactory.GetInstance<ProductService>());
Here is the error message...
{"StructureMap Exception Code: 202\nNo Default Instance defined for PluginFamily ASPPatterns.Chap8.MVP.Model.IProductRepository, ASPPatterns.Chap8.MVP.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"}

Any thoughts?

Thanks
Tim Tatum

Hi,

make sure you have set up the default implementation instance for IProductRepository in the Bootstrapper.cs file.
 
Old February 1st, 2013, 11:33 AM
Registered User
 
Join Date: Jul 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks for your help!

Got it.

When I looked at Bootstrapper I found that I had

Code:
ForRequestedType<CategoryRepository>().TheDefault.Is.OfConcreteType<CategoryRepository>();
instead of

Code:
ForRequestedType<ICategoryRepository>().TheDefault.Is.OfConcreteType<CategoryRepository>();
Once I fixed that all worked well.

Thanks for your help!

Tim





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified soufya BOOK: Beginning ASP.NET 4 : in C# and VB 7 September 14th, 2011 08:08 AM
MVP pattern IxxxView question samvan BOOK: Professional ASP.NET Design Patterns 2 November 25th, 2010 10:25 AM
Invite: Chat About Microsoft Office and Windows with Microsoft MVP Experts HiTechCoach Access 0 October 13th, 2010 05:11 PM
Microsoft MVP Donald Belcham to Speak on Live Mesh Shaguf ASP.NET 3.5 Professionals 0 December 5th, 2008 06:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.