skip to Main Content

GoDaddy migrated my Economy Windows Hosting to Plesk Windows Hosting.
The static hmtl pages displayed fine. However, my web service using .Net 4 with WCF to provide
a RESTful api failed showing the configuration error below:

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.

At GoDaddy, using Plesk Admin, I see the app directory for the service in the list of virtual directories,
and when I select the directory and click on the Directory Properties at the top,
the properties show the Application settings. So I don’t know what the problem could be.

2

Answers


  1. Chosen as BEST ANSWER

    My Solution

    It turned out there were two problems:
    1. The app directory was not a virtual directory.
    2. The Web.config file in the app directory needed to have the connectionSettings updated because the database server ip address had changed.
    More details follow if interested. At GoDaddy, Plesk Admin is being used, and myapp is the name of the virtual directory:
    1. I mistakenly thought the app directory was a virtual directory when it was not.
      • Navigate to Websites & Domains > Virtual Directories.
      • At the top of the page, click Create Virtual Directory, which opens Create Virtual Directory:
        • Uncheck the Path checkbox and use the folder icon that appears to browse to the physical path, which is /httpdocs/myapp
        • Set Name to myapp
        • The other default settings are probably fine.
        • Click OK
      • Now on the Virtual Directories page, you can tell that myapp is a virtual directory because the middle icon of the three icons on the right is enabled (hover tip shows as Web directory management).
      • Note: To see the details of the web server exception in the Chrome Browser, the Web.config file in the myapp directory needs to have the following element in the <system.web> section:
        • <customErrors mode="Off"/>
        • Now in the Chrome browser > Settings > More Tools > Development Tools > Network Tab, you can see the request causing the error.
        • Click on the request for details and click the Preview tab to see information about the exception.
    2. Set the connectionString setting for the database server in the myapp/Web.config:
      • The ip address of the server can be found at
        Databases > your database > Connection Info
        The the Host (server) ip is shown including a port, e.g. n.n.n.n:port. Only use the n.n.n.n without the port.
      • Set password for your database if need be: Databases > your database > click on a User
        The Database User page is shown where you set a New password.
      • Edit Web.config: Files > httpsdocs/myapp/Web.config > Menu icon > Edit in Code Editor
        In the <connectStrings> section, for your connection string change:
        • Server=n.n.n.n where n.n.n.n is the database server ip without any port.
        • Password=xxx where xxx is the password for the database.


  2. To fix above issue, you just ask Godaddy to convert your directory to application in IIS. Since on shared hosting, you don’t have ability to login to the server, then you must ask them. Or in control panel, please kindly create it as Virtual Directory on your Plesk Control panel.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search