Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:45:33+00:00 2026-06-15T23:45:33+00:00

We are using Unity as our IoC container in an MVC3 project. We just

  • 0

We are using Unity as our IoC container in an MVC3 project. We just installed dynatrace, and it is showing an inordinate amount of time spent in a FileSystemWatcher.StartRaisingEvents method, specifically in ReadDirectoryChangesW. This seems to be contributing to bad performance.

Why on earth would Unity be monitoring the file system?

Here's the call stack:

ChildActionExtensions.RenderAction
  HttpServerUtility.Execute
    HttpHandlerUtil+ServerExecuteHttpHandler.Wrap
      UnityControllerFactory.CreateController
        XmlConfigurator.ConfigureAndWatch
          FileSystemWatcher.StartRaisingEvents
            UnsafeNativeMethods.ReadDirectoryChangesW

Here is the UnityControllerFactoryCode

        try
        {
            if (requestContext.RouteData.DataTokens.ContainsKey("area") && !string.IsNullOrWhiteSpace(requestContext.RouteData.DataTokens["area"].ToString()))
            {
                controllerName = string.Format("{0}/{1}", requestContext.RouteData.DataTokens["area"], controllerName);
            }

            controllerName = controllerName.ToLower();

            return _container.Resolve<IController>(controllerName);
        }
        catch (Exception ex)
        {
            if (ex is ResolutionFailedException)
            {
                IMyLogger logger = _container.Resolve<IMyLogger>();
                logger.Error(LogEventIdType.General, ex, "Is the '{0}' controller defined in the Unity Container via RegisterType (in lowercase) in UnityIocBootstrapConfigure?", new object[] {controllerName});
                throw;
            }             
        }

The logger logs to the Windows event log.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:45:34+00:00Added an answer on June 15, 2026 at 11:45 pm

    Your trace is pointing to XmlConfigurator, which is log4net. log4net stores its configuration in a separate file from the web.config, so it starts a File System Watcher to check if the file has changed to reconfigure itself.

    It would seem that the culprit of your performance problems then is log4net, not Unity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our project is using constructor-based Dependency Injection (we're using Unity as our container) and
Our current project is written in ASP.NET MVC 1 using mvc-turbines (and unity) for
We've been using Unity for our ASP.NET MVC3 applications. The configuration is done solely
I am using Unity with MVC and NHibernate. Unfortunately, our UnitOfWork resides in a
We typically only reference Microsoft.Practices.Unity.dll in our applications. We're only using basic capabilities, and
I'm looking into using parallel unit tests for our project(s) and was wondering about
I am using Unity for IOC. I would like to configure the creation of
We have our project build using maven. We try to run our unit test
We are using unity as IoC. We came across unique problem. We have created
We're using Ninject for IOC. All of our Repository objects can (and should be)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.