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

  • Home
  • SEARCH
  • 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 8889761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:20:28+00:00 2026-06-14T22:20:28+00:00

ASP.NET Web API project template in Visual Studio 2012 is a specialized MVC4 project

  • 0

ASP.NET Web API project template in Visual Studio 2012 is a specialized MVC4 project and after creating an instance of such a project, right clicking on the “Controllers” folder shows you “Add >> Controller” menu item which triggers the controller generator. (scaffolding)

On the other hand, it is also possible to host an ASP.NET Web API server in a console application, which is called in the documentation a Self-Host application.

http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api

My question is:
How can I use the “Controller Scaffolding” if I am developing a self hosting console application?

  • 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-06-14T22:20:30+00:00Added an answer on June 14, 2026 at 10:20 pm

    Scaffolding is still supported via the package manager console e.g. here.

    But the MVC specific “Add Controller” dialog is indeed reserved for MVC project files.

    You can however, force your self host project to include this dialog.

    This can be achieved by adding a line into the project file to “trick” visual studio into thinking your self host app is a MVC app. See this question for details "Add Controller" / "Add View" in a hybrid MVC/WebForms ASP.NET application

    If you:

    1. Create a Controllers folder under your project root
    2. Right mouse button your self host project file and “Unload Project”
    3. Right mouse button your self host project file “Edit “
    4. Under the Xml > Project -> PropertyGroup Add the node shown under the steps
    5. Save
    6. Right mouse button your self host project file click reload project

      <ProjectTypeGuids> 
          {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
      </ProjectTypeGuids>
      

    Once you have done this you can start playing around with TT files (scaffolds) to make them more useful/specific to self hosting http://www.hanselman.com/blog/ModifyingTheDefaultCodeGenerationscaffoldingTemplatesInASPNETMVC.aspx

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

Sidebar

Related Questions

When creating a default ASP.NET Web Api project, default ValuesController has post method like
I create a new ASP.NET Web API project. I then use nuget to pull
I am creating a ASP.Net Web API to expose an existing database for use
Following the example in this article: http://blogs.msdn.com/b/yaohuang1/archive/2012/05/21/asp-net-web-api-generating-a-web-api-help-page-using-apiexplorer.aspx I've set up everything to provide documentation
I have an ASP MVC Web Api project that outputs json using json.net. I
How do I mix Web API and ASP.Net MVC pages in one project? For
I have an ASP.NET Web API project. I'm trying to pass some query options
How do I handle versioning in my ASP.NET Web-Api project? I need to have
All, I have a ASP.NET Web API project that is making a REST call
Is it possible to use Web Api in an existing project of Asp.Net MVC

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.