Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > BOOK: Professional ASP.NET Design Patterns
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 30th, 2013, 03:32 PM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #2 (permalink)  
Old February 1st, 2013, 01:59 AM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 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.
Reply With Quote
  #3 (permalink)  
Old February 1st, 2013, 10:33 AM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09: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 05:11 AM



All times are GMT -4. The time now is 07:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.