Cannot access 'Orchard.Modules.dll' because it is being used by another process.

Topics: Administration
Feb 23 at 7:27 PM
Can anyone shed any insight into this error? I pulled this from my eventlog.xml file on Azure. My site experienced this error many times over an 11-hour period and was mostly unresponsive during that time.
    Exception type: ApplicationException

    Exception message: Error during application initialization
   at Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in c:\Projects\Orchard\src\Orchard.WarmupStarter\Starter.cs:line 63
   at Orchard.Web.MvcApplication.Application_BeginRequest() in c:\Projects\Orchard\src\Orchard.Web\Global.asax.cs:line 29

The process cannot access the file 'D:\home\site\wwwroot\App_Data\Dependencies\Orchard.Modules.dll' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at Orchard.FileSystems.AppData.AppDataFolder.StoreFile(String sourceFileName, String destinationPath) in c:\Projects\Orchard\src\Orchard\FileSystems\AppData\AppDataFolder.cs:line 141
   at Orchard.FileSystems.Dependencies.DefaultAssemblyProbingFolder.StoreAssembly(String moduleName, String fileName) in c:\Projects\Orchard\src\Orchard\FileSystems\Dependencies\DefaultAssemblyProbingFolder.cs:line 61
   at Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader.<>c__DisplayClassd.b__b() in c:\Projects\Orchard\src\Orchard\Environment\Extensions\Loaders\PrecompiledExtensionLoader.cs:line 77
   at Orchard.Environment.Extensions.ExtensionLoaderCoordinator.ProcessContextCommands(ExtensionLoadingContext ctx) in c:\Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionLoaderCoordinator.cs:line 366
   at Orchard.Environment.Extensions.ExtensionLoaderCoordinator.SetupExtensions() in c:\Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionLoaderCoordinator.cs:line 74
   at Orchard.Environment.DefaultOrchardHost.BuildCurrent() in c:\Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:line 101
   at Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in c:\Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:line 67
   at Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in c:\Projects\Orchard\src\Orchard.Web\Global.asax.cs:line 48
   at Orchard.WarmupStarter.Starter`1.<>c__DisplayClass3.b__2(Object state) in c:\Projects\Orchard\src\Orchard.WarmupStarter\Starter.cs:line 89
Developer
Feb 24 at 2:02 PM
I have no idea, but could it have something to do with dynamic compilation? Is it enabled (see HostComponents.config)?
Feb 24 at 5:56 PM
It looks like it is enabled:
<?xml version="1.0" encoding="utf-8"?>
<HostComponents>
    <Components>

        <Component Type="Orchard.Environment.Extensions.ExtensionMonitoringCoordinator">
            <Properties>
                <!-- Set Value="true" to disable new extensions monitoring -->
                <Property Name="Disabled" Value="false"/>
            </Properties>
        </Component>

        <Component Type="Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy.PlacementFileParser">
            <Properties>
                <!-- Set Value="true" to disable Placement files monitoring (Placement.info) -->
                <Property Name="DisableMonitoring" Value="true"/>
            </Properties>
        </Component>

        <Component Type="Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy">
            <Properties>
                <!-- Set Value="true" to disable template views monitoring (Views\*.cshtml) -->
                <Property Name="DisableMonitoring" Value="true"/>
            </Properties>
        </Component>

        <Component Type="Orchard.Environment.Extensions.Folders.ExtensionHarvester">
            <Properties>
                <!-- Set Value="true" to disable extension folders monitoring (new files in modules and themes) -->
                <Property Name="DisableMonitoring" Value="false"/>
            </Properties>
        </Component>

        <Component Type="Orchard.Environment.Extensions.Compilers.DefaultProjectFileParser">
            <Properties>
                <!-- Set Value="true" to disable project files monitoring (/Modules/**/*.csproj) -->
                <Property Name="DisableMonitoring" Value="true"/>
            </Properties>
        </Component>

        <Component Type="Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader">
            <Properties>
                <!-- Set Value="true" to disable source files monitoring -->
                <Property Name="DisableMonitoring" Value="true"/>
                <!-- Set Value="true" to completely disable the Dynamic Extension Loader -->
                <Property Name="Disabled" Value="false"/>
            </Properties>
        </Component>

        <Component Type="Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader">
            <Properties>
                <!-- Set Value="true" to disable pre-compiled files monitoring (~/Modules/**/bin/*.dll) -->
                <Property Name="DisableMonitoring" Value="true"/>
            </Properties>
        </Component>

        <Component Type="Orchard.FileSystems.Dependencies.DefaultDependenciesFolder">
            <Properties>
                <!-- Set Value="true" to disable the dependencies folder monitoring -->
                <Property Name="DisableMonitoring" Value="true"/>
            </Properties>
        </Component>

        <Component Type="Orchard.FileSystems.Dependencies.DefaultExtensionDependenciesManager">
            <Properties>
                <!-- Set Value="true" to disable compiled dependencides files monitoring -->
                <Property Name="DisableMonitoring" Value="true"/>
            </Properties>
        </Component>

        <Component Type="Orchard.Localization.Services.DefaultLocalizedStringManager">
            <Properties>
                <!-- Set Value="true" to disable localization files monitoring (*.po) -->
                <Property Name="DisableMonitoring" Value="true"/>
            </Properties>
        </Component>

        <Component Type="Orchard.Caching.DefaultParallelCacheContext">
            <Properties>
                <!-- Set Value="true" to disable parallel cache resolution -->
                <Property Name="Disabled" Value="false"/>
            </Properties>
        </Component>

    </Components>
</HostComponents>