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 117745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:23:06+00:00 2026-05-11T03:23:06+00:00

Where is the Web.config supposed to go in an ASP.NET MVC project? I just

  • 0

Where is the Web.config supposed to go in an ASP.NET MVC project?

I just ran into an error trying to do this:

_cnstr = System.Configuration.ConfigurationManager.     ConnectionStrings['production'].ConnectionString; 

The default MVC template puts the Web.config at the root of the project.

If you go into the properties of a project (the screen with the vertical tabs). Go to settings and try to create an application setting, it will prompt you that you don’t have a config file. When it creates the file it does it at the base of the Views folder. So now I have two Web.config files. Is this how it supposed to be?

And I guess I should put my connection string in the ‘views’ web.config to avoid the error. Thoughts? Is this a bug in the last release of the ASP.NET MVC bits?

UPDATE: See David’s answer

  • 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. 2026-05-11T03:23:06+00:00Added an answer on May 11, 2026 at 3:23 am

    The settings should go into the web.config at the application root. The web.config in the views folder is there to block direct access to the view aspx pages which should only get served through controllers.

    (And: I tried creating application settings on my machine, with ASP.NET MVC RC 1 installed, using a newly created mvc web application. They get added to the web.config at the application root.)

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

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 73k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You could drop the primary key column and re-create it.… May 11, 2026 at 1:56 pm
  • added an answer IEnumerable<Type> GetTypesWith<TAttribute>(bool inherit) where TAttribute: System.Attribute { return from a… May 11, 2026 at 1:56 pm
  • added an answer But find didn't get executed without a value for start… May 11, 2026 at 1:56 pm

Related Questions

It seems that the trend in web design is to provide paged output, where
I've done many web apps where the first thing you do is make a
Where is the option in Visual Studio to make the Home key go to
Where is the location of my oracle event log (on a default Linux installation)?
I've recently inherited an application that makes very heavy use of session, including storing
In a web-app I'm writing, the user is supposed to enter the path in
I need to call a web service written in .NET from Java. The web
I am looking at the performance suggestions lots of pages have about asp.net. Specifically

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.