Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3273326
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:55:12+00:00 2026-05-17T18:55:12+00:00

I have this code for on ASP.NET MVC website: x.For<AccountController>().TheDefault.Is.ConstructedBy(() => new AccountController()); This

  • 0

I have this code for on ASP.NET MVC website:

x.For<AccountController>().TheDefault.Is.ConstructedBy(() => new AccountController());

This code throws a warning which seems quite self explanatory but for some reason when I use the “Use” method it doesn’t seem to work. I know I am doing something wrong and would appreciate some help.

The warning is:

Warning 1 ‘StructureMap.Configuration.DSL.Expressions.CreatePluginFamilyExpression.TheDefault’ is obsolete: ‘”Prefer the Use() methods”

Thank You.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:55:13+00:00Added an answer on May 17, 2026 at 6:55 pm

    If you look at the XMLDoc for the third overload on the “Use” method, it says this:

    Shorthand to say
    TheDefault.IsThis(@object)

    Therefore, simply do it like this:

    For<AccountController>().Use(() => new AccountController());
    

    Although i’m not sure what the point of this is (injecting a concrete when something requests a concrete), unless this is just an example, and you’re really doing something else.

    Normally for the MVC Controllers, you create a ControllerFactory – i haven’t seen a need to “explicitly” inject a concrete Controller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a beginner level question for asp.net MVC I have the following code
We have a website which we recently migrated to ASP.NET MVC. All of the
I have this code in my ASP.NET application written in C# that is trying
In code-behind of an ASP.NET page I have this method: public string TestFunc() {
I have ASP.Net code similar to the following (this is inside a FIELDSET): <ol>
I have an ASP.NET MVC application for which I store uploaded content files in
i have an asp.net mvc website with a SQL server backend. For every table
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
I have an ASP.NET MVC-application which I want deployable on both IIS6 and IIS7
I have an ASP.NET MVC (Beta 1) website that I'm using themes with. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.