CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2014
    Posts
    48

    Web.config error in 2017

    Hello

    I am coming to terms with the Web Forms Identity template and when I try to compile my Web Forms project in VS 2017, I get the following: error ASPCONFIG in my Web.config(18) file:

    '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'.

    I see no reference to allowDefinition or MachineToApplÃ*cation in the entire Solution - let alone Web.config - when I search for either of those terms. This is line 18 in my Web.config file:

    Code:
    <authentication mode="None"/>
    There seems to be two servers that my project uses which I can see in SQL Server Object Explorer:

    (localdb)\MSSQLLocalDB (SQL Server 13.0.4001)
    (localdb)\ProjectsV13 (SQL Server 13.0.4001)

    If I need to configure a virtual directory as an application in IIS, how would I do that and which directory?!

    It's all a bit beyond me, but thank you for any help.

    Thanks

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Web.config error in 2017

    Are you running Visual Studio as an administrator? If not, try running it as an admin. See if the problem resolves itself (if not, post back).

  3. #3
    Join Date
    Sep 2014
    Posts
    48

    Re: Web.config error in 2017

    Hello Arjay

    Thanks for your reply.

    Unfortunately, I am still getting that same error as administrator in Cmd Prompt which is how I usually compile:

    C:\Users\Steve\source\repos\WebFormsIdentity\webformsidentity\web.config(18): error ASPCONFIG: 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.

    C:\>

    I can trying compiling (building?) via VS 2017 as admin, though I have never done it that way before.

    Thanks again.

  4. #4
    Join Date
    Sep 2014
    Posts
    48

    Re: Web.config error in 2017

    Hello Arjay

    This is the output of my 'Build' test from within VS2017 itself.

    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    ========== Publish: 1 succeeded, 0 failed, 0 skipped ==========


    I assume that these pre-compiled files (I selected the pre-compile checkbox during the build) still need to be compiled before FTP uploading them to my Web hosting service's server, but that still doesn't resolve the server error message - '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' - that I get through Cmd Prompt, does it?

    Thanks again.

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Web.config error in 2017

    Is IIS installed on the machine where you are compiling the code? Have you created an IIS virtual application?

  6. #6
    Join Date
    Sep 2014
    Posts
    48

    Re: Web.config error in 2017

    Thanks, Arjay

    Yes, IIS is installed - I can see the icon next to the clock on my screen. I haven't created a virtual application, no. I wouldn't know how to do it! The error implies that I should be, doesn't it?

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured