Solved

I am getting the message.. An error occurred loading a configuration file. Directory C:\inetpub\wwwroot\api\configuration' does not exist. Failed to start monitoring file changes

Posted on 2014-02-10
7
1,170 Views
Last Modified: 2014-03-29
I have a Windows 7x64 development computer that is running Visual Studio 2012 update 4. I have IIS7 installed on my development computer

I want to use my local IIS to run web services code written by a former employee so that I can test and debug some methods. This code is, and has been, running on a production server for some time and generally works. It is just kicking out a weird response to one of the methods that I need to debug.

I loaded the project source code in VS2012, built and published it to my local hard drive with no errors.

I then copied the code to my local IIS7 directory tree, right-clicked on the folder containing the code in IIS7 and selected 'Convert to application".

I set the Application Pool to ASP.NET v4.0 to match the setting in the production server

I assigned the Identity value of the application to a domain user account that is a member of the local administrators group on my development computer.

In the IIS 7 basic settings dialog for the application, I set the "Connect as..." to the same user account as the application pool identity. I can click on the "Test Setting..." button and both the Authentication and Authorization tests pass.

I restart IIS7 and then navigate to the localhost URL to see if the services.svc file will run and I get the following error;

Parser Error Message: An error occurred loading a configuration file: Directory 'C:\inetpub\wwwroot\api\v4.1\Configuration' does not exist. Failed to start monitoring file changes.

Source Error: [No relevant source lines]

Source File: c:\inetpub\wwwroot\api\v4.1\web.config  Line: 0

I have checked the security properties for the folder and I have given the user account I used for the Application Pool full rights. I can see that there is an actual web.config file in the folder and when checking the security of the web.config file, the user account assigned to the application pool has full rights to the file.

I put a default.htm file in the C:\inetpub\wwwroot\API\V4.1 folder and I can browse and display that file in a web browser.

Any ideas?

Thanks in advance for any help you can provide,

Dave
0
Comment
Question by:dcadler
  • 4
  • 2
7 Comments
 
LVL 8

Assisted Solution

by:Scott Thompson
Scott Thompson earned 250 total points
ID: 39849226
If the file is being ran from a separate computer, maybe it is looking for  c:\inetpub\wwwroot\api\v4.1\web.config on that computer, and not the computer hosting the files.
0
 

Author Comment

by:dcadler
ID: 39850169
I am running the API on my localhost IIS and pointing my browser at the services.svc file on my localhost. That is when I get the error.

I would think that it since I have the API running on my local host and I am pointing my browser at http://localhost/API/V4.1/Services.svc, it would have to at least look at the web.config in that directory, right.
0
 
LVL 8

Expert Comment

by:Scott Thompson
ID: 39850307
Unfortunately, I don't know much about IIS.  I just thought I would throw my two cents in and hoped it would help :(
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 10

Accepted Solution

by:
John Claes earned 250 total points
ID: 39850698
it depends on what directory you created your IIS website/ virtual directory.
IIS loads the Web.config from the root of the website/virtual directory.

so if the Svc is in a subdirectory of an other project, and you only mapped the bigger project, the web.config from your svc is loaded as the svc is seen as a part of the bigger project.
you should include the SVC folder also in IIS to ensure the loading of the correct web.config.
0
 

Author Comment

by:dcadler
ID: 39851925
the service.svc that I am pointing to is in the same directory as the web.config. The path is C:\inetpub\wwwroot\api\v4.1\

That folder has the web.config file and the service.svc


Then I select the V4.2 application in the IIS tree, under default website, and then click on "Basic Settings" in IIS, I have the following set;

Path: /API
Alias: V4.1
Physical Path: C:\inetpub\wwwroot\API\V4.1

In the c:\inetpub\wwwroot\API\V4.1 folder, I have the following files (along with many others);

service.svc
web.config
default.htm


I can point my browser at http://localhost/api/V4.1/default.htm and it displays.
If I point my browser at http://localhost/api/V4.1/service.svc, I get the error described in my original post.
0
 

Author Comment

by:dcadler
ID: 39873410
I added a simple test.aspx page to the application folder. If I point the browser at that page, it still fails with the error similar to my original post. However, if I remove the web.config file from the application folder, the simple test.aspx file runs.

This would indicate a problem with the web.config or some process that the web.config is trying to start or communicate with, correct?

Listed below is my web.config file. I have changes any company specific references for privacy purposes.

Any ideas as to why having this file in my web application folder causes the error listed in my original post?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="ACIService.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <appSettings configSource="Configuration\appSettings.config" />
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Warning, ActivityTracing" propagateActivity="true">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelTraceListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
      <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelMessageLoggingListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="c:\APILogs\app_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, &#xD;&#xA;         Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
      <add initializeData="c:\APILogs\app_messages.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, &#xD;&#xA;         Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>
  <system.web>
    <!-- 
        Visual Basic options:
        Set strict="true" to disallow all data type conversions 
        where data loss can occur. 
        Set explicit="true" to force declaration of all variables.
    -->
    <httpRuntime maxQueryStringLength="2097151" maxUrlLength="2097151" maxRequestLength="2147483647" />
    <compilation strict="false" explicit="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <namespaces>
        <clear />
        <add namespace="System" />
        <add namespace="System.Collections" />
        <add namespace="System.Collections.Generic" />
        <add namespace="System.Collections.Specialized" />
        <add namespace="System.Configuration" />
        <add namespace="System.Runtime.Serialization" />
        <add namespace="System.Text" />
        <add namespace="System.Text.RegularExpressions" />
        <add namespace="System.Linq" />
        <add namespace="System.Xml.Linq" />
        <add namespace="System.ServiceModel.Web" />
        <add namespace="System.Web" />
        <add namespace="System.Web.Caching" />
        <add namespace="System.Web.SessionState" />
        <add namespace="System.Web.Security" />
        <add namespace="System.Web.Profile" />
        <add namespace="System.Web.UI" />
        <add namespace="System.Web.UI.WebControls" />
        <add namespace="System.Web.UI.WebControls.WebParts" />
        <add namespace="System.Web.UI.HtmlControls" />
      </namespaces>
    </pages>
    <!--
        The <authentication> section enables configuration 
        of the security authentication mode used by 
        ASP.NET to identify an incoming user. 
    -->
    <authentication mode="None" />
    <!--
        The <customErrors> section enables configuration 
        of what to do if/when an unhandled error occurs 
        during the execution of a request. Specifically, 
        it enables developers to configure html error pages 
        to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
         <error statusCode="403" redirect="NoAccess.htm"/>
         <error statusCode="404" redirect="FileNotFound.htm"/>
        </customErrors>
    -->
  </system.web>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="support@ACI.com">
        <network host="mailprocessor.aci" port="25" />
      </smtp>
    </mailSettings>
  </system.net>
  <!-- 
      The system.webServer section is required for running ASP.NET AJAX under Internet
      Information Services 7.0.  It is not necessary for previous version of IIS.
  -->
  <system.webServer>
    <defaultDocument>
      <files>
        <add value="Service.svc" />
      </files>
    </defaultDocument>
  </system.webServer>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <!--<binding name="LessExtremeLength" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="250000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
          <security mode="TransportWithMessageCredential"/>
        </binding>-->
        <binding closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" />
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
      <basicHttpBinding>
        <binding closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="9999" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" />
          </security>
        </binding>
        <binding name="SwsimV27Soap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="SwsimV27Soap1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <services>
      <service behaviorConfiguration="ACI.Service.ServiceBehavior" name="ACIService.Tracking.TrackingService">
        <endpoint address="" behaviorConfiguration="ACI.Service.EndpointBehavior" binding="basicHttpBinding" contract="ACIService.Tracking.ITrackingService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
      </service>
      <service behaviorConfiguration="ACI.Service.ServiceBehavior" name="ACIService.Account.Service">
        <endpoint address="" behaviorConfiguration="ACI.Service.EndpointBehavior" binding="basicHttpBinding" contract="ACIService.Account.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
      </service>
      <service behaviorConfiguration="ACI.Service.ServiceBehavior" name="ACIService.SupportingData.Service">
        <endpoint address="" behaviorConfiguration="ACI.Service.EndpointBehavior" binding="basicHttpBinding" contract="ACIService.SupportingData.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
      </service>
      <service behaviorConfiguration="ACI.Service.ServiceBehavior" name="ACIService.Service">
        <endpoint address="" behaviorConfiguration="ACI.Service.EndpointBehavior" binding="basicHttpBinding" contract="ACIService.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
      </service>
      <!--<service behaviorConfiguration="ACI.Service.ServiceBehavior" name="ACIService.Service">
        <endpoint address="" behaviorConfiguration="ACI.Service.EndpointBehavior" binding="wsHttpBinding" contract="ACIService.IService">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>-->
      <service behaviorConfiguration="ACI.Service.ServiceBehavior" name="ACIService.Stamps.Service">
        <endpoint address="" behaviorConfiguration="ACI.Service.EndpointBehavior" binding="basicHttpBinding" contract="ACIService.Stamps.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
      </service>
      <service behaviorConfiguration="ACI.Service.ServiceBehavior" name="ACIService.WebStore.Service">
        <endpoint address="" behaviorConfiguration="ACI.Service.EndpointBehavior" binding="basicHttpBinding" contract="ACIService.WebStore.IWebStoreService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="ACI.Service.EndpointBehavior">
          <dataContractSerializer maxItemsInObjectGraph="2147483646" />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="ACI.Service.ServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483646" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <client>
      <endpoint address="https://swsim.stamps.com/swsim/swsimv27.asmx" binding="basicHttpBinding" bindingConfiguration="SwsimV27Soap" contract="StampsV27.SwsimV27Soap" name="SwsimV27Soap" />
    </client>
  </system.serviceModel>
  <applicationSettings>
    <ACIService.My.MySettings>
      <setting name="ACI_Service_ACEService_ACEService" serializeAs="String">
        <value>http://as2/ASPACEService/ACEService.asmx</value>
      </setting>
    </ACIService.My.MySettings>
  </applicationSettings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
</configuration>

Open in new window

0
 

Author Comment

by:dcadler
ID: 39911252
No responses for a while. Any ideas?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question