server application error...virtual directory?

Discussion in 'Windows / IIS' started by bcsmith, Apr 13, 2009.

  1. I am trying to learn how to publish an asp.net MVC application to discount asp.net
    I am trying to publish the NerdDinner demo (from the asp.net MVC people) to learn
    the process. I Have, in the past worked with asp.net 2.0 and windows 2003/iis 6.
    Here I am trying to publish with Visual Studio 2008 (asp.net MVC web application) to IIS 7.

    I am currently getting the common "Server Error in '/' Application. I have
    read the forum and realize that this error can be caused by LOTS of different
    things. From past work, and from the error messages, I believe that my problem
    is due to the directory structure I have on the dasp site. I am using
    www.xxxxxxx/NerdDinner (as a subject directory within my site).

    I am not sure what the Virtual Directory is, but I think this is the problem,
    Is it new with IIS7 or did I not configure something correctly in the web.config
    file so that it understands my released directory structure?



    For the upload I did a standard Visual Studios 2008 publish all files.
    I have done some reading about publishing
    asp.net MVC web applications and I know that there are some files that I need to get from my
    bin.....I think these are there, but I am not totally sure......

    I have set the ConnectionStrings.config file in the dasp site to work with published databases.


    Could someone point me to a good documentation on how to publish asp.net MVC applications.
    I have found some examples, but nothing great. Also, any help on what I am currently doing
    wrong would be very appreciated.



    ==========================================================

    Here is the error I am getting:

    Server Error in '/' Application.
    Configuration Error
    Description: An error occurred during the processing of a configuration file
    required to service this request. Please review the specific error details
    below and modify your configuration file appropriately.

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

    Source Error:

    Line 65: ASP.NET to identify an incoming user.
    Line 66: -->
    Line 67: <authentication mode="Forms">
    Line 68: <forms loginUrl="~/Account/Logon" />
    Line 69: </authentication>


    Source File: E:\web\briansmithi\htdocs\nerddinner\web.config Line: 67


    Show Additional Configuration Errors:

    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. (E:\web\briansmithi\htdocs\nerddinner\web.config line 70)

    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. (E:\web\briansmithi\htdocs\nerddinner\web.config line 89)

    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. (E:\web\briansmithi\htdocs\nerddinner\web.config line 98)



    ==========================================================


    Here is the web.config file:

    <?xml version="1.0"?>
    <!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration>
    <configSections>
    <sectionGroup name="system.web.extensions"
    type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <sectionGroup name="scripting"
    type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler"
    type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false"
    allowDefinition="MachineToApplication" />
    <sectionGroup name="webServices"
    type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="jsonSerialization"
    type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false"
    allowDefinition="Everywhere" />
    <section name="profileService"
    type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false"
    allowDefinition="MachineToApplication" />
    <section name="authenticationService"
    type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false"
    allowDefinition="MachineToApplication" />
    <section name="roleService"
    type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    requirePermission="false"
    allowDefinition="MachineToApplication" />
    </sectionGroup>
    </sectionGroup>
    </sectionGroup>
    </configSections>
    <connectionStrings configSource="ConnectionStrings.config" />
    <system.web>
    <!--
    Set compilation debug="true" to insert debugging
    symbols into the compiled page. Because this
    affects performance, set this value to true only
    during development.
    -->
    <compilation debug="true">
    <assemblies>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    </assemblies>
    </compilation>
    ......
     
  2. Did you set the subdirectory you uploaded your application as an application directory. Log into your discountasp hosting control panel and go to Web Application Tool.
     
  3. Thanks to both of you....I was following some of the MVC columns (now and then) but not all of them...I will do this. now..

    And....

    I had not set the web application on the directory....I did this and the application is now running !!!!!!! thank you.
     

Share This Page