1

I'm creating a very simplistic MVC3 website. I need to add no database authenication.

I'm using a standard MVC project with the scaffolded account controller.

In the web.config file I have

        <authentication mode="Forms">
            <forms loginUrl="~/Account/LogOn">
                <credentials passwordFormat="Clear">
                    <user name="admin" password="mypassword" />
                </credentials>
            </forms>
        </authentication>

I get the following error. (I'm using casinni, This error is usally because an Application hasnt been declared)

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Any ideas how to fix?

tereško
  • 58,060
  • 25
  • 98
  • 150
Mantisimo
  • 4,203
  • 5
  • 37
  • 55

2 Answers2

3

I've been a massive numpty! I've been editing the wrong web.config file!

I edited the one under the /views folder when I should have edited the one under the root, doh!

Mantisimo
  • 4,203
  • 5
  • 37
  • 55
  • This was MASSIVELY helpful to me. I never thought about there being another webconfig file, and boom--sure enough, that's the one I was editing, too. – Brian Warshaw Jun 06 '12 at 18:39
0

Try Build and clean the solution. I have to do it after I publish. Also see this question

Community
  • 1
  • 1
GraemeMiller
  • 11,973
  • 8
  • 57
  • 111