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

  • Home
  • SEARCH
  • 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 8502007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:22:03+00:00 2026-06-11T01:22:03+00:00

I’m trying the get the mini profiler for RavenDb running in my ASP.NET MVC4

  • 0

I’m trying the get the mini profiler for RavenDb running in my ASP.NET MVC4 project.

I have the following in my Unity bootstrapper:

[assembly: WebActivator.PreApplicationStartMethod(typeof(Web.App.App_Start.AppStart_Unity), "Start")]
public static class AppStart_Unity
{
    public static void RegisterServices(IUnityContainer container)
    {
        container.RegisterInstance(DocumentStoreFactory.Create(ConfigurationManager.ConnectionStrings[0].Name));
        container.RegisterType<IDocumentSession>(new HierarchicalLifetimeManager(), new InjectionFactory(c => c.Resolve<IDocumentStore>().OpenSession(ConfigurationManager.ConnectionStrings[0].Name)));
    }

    public static void Start()
    {
        // Create the unity container
        IUnityContainer container = new UnityContainer();

        // Register services with our Unity container
        RegisterServices(container);

        // Tell ASP.NET MVC to use our Unity DI container
        DependencyResolver.SetResolver(new UnityServiceLocator(container));

        // hook up the profiler    
        var store = container.Resolve<IDocumentStore>();
        var documentStore = store as DocumentStore;
        if (documentStore != null)
        {
            Raven.Client.MvcIntegration.RavenProfiler.InitializeFor(documentStore);
        }
    }
}

In my master _Layout I have the following:

<head>
    @Raven.Client.MvcIntegration.RavenProfiler.CurrentRequestSessions()
</head>

The first time I start up the web application I can see the profiler, no problem.

However, any subsequent page requests and the profiler is not visible.

When I look at the page source, I can see the div container is there, but unpopulated with data. No JavaScript errors at all. Very odd. The HTML rendered looks like this:

<div class="ravendb-profiler-results">
    <div id="ravendb-session-container"></div>
    <p></p>
    <a href="#" class="ravendb-toggle ravendb-close">Close</a>
</div>

Comparing the requests, I see these requests in the first load:

  1. http://localhost:62238/ravendb/profiling?path=yepnope.js
  2. http://localhost:62238/ravendb/profiling?path=jquery.tmpl.min.js
  3. http://localhost:62238/ravendb/profiling?path=ravendb-profiler-scripts.js
  4. http://localhost:62238/ravendb/profiling?path=jquery.tmpl.min.js
  5. http://localhost:62238/ravendb/profiling?path=ravendb-profiler-scripts.js
  6. http://localhost:62238/ravendb/profiling?path=Templates%2Ftotals.tmpl.html
  7. http://localhost:62238/ravendb/profiling?path=Templates%2Fravendb-profiler.tmpl.html
  8. http://localhost:62238/ravendb/profiling?path=Templates%2Fsession-template.tmpl.html
  9. http://localhost:62238/ravendb/profiling?path=Templates%2Frequest-details.tmpl.html
  10. http://localhost:62238/ravendb/profiling?id%5B%5D=d3ada4e4-4bc3-4a7c-bd36-64cc8017d94a
  11. http://localhost:62238/ravendb/profiling?path=styles.css

In subsequent loads, I see the following requests:

  1. http://localhost:62238/ravendb/profiling?path=yepnope.js
  2. http://localhost:62238/ravendb/profiling?path=jquery.tmpl.min.js
  3. http://localhost:62238/ravendb/profiling?path=ravendb-profiler-scripts.js
  4. http://localhost:62238/ravendb/profiling?path=jquery.tmpl.min.js
  5. http://localhost:62238/ravendb/profiling?path=ravendb-profiler-scripts.js

Oddly, I’m seeing duplicated calls in both cases for jquery.tmpl.min.js and ravendb-profiler-scripts.js.

The ravendb-profiler-scripts.js contains the line:

 9. var load = function () {
10. if (options.id.length == 0)
11.    return;

In the subsequent loads, options.id.length is zero. The templates then don’t load, and the results are not fetched.

The first page load contains the script:

<script type="text/javascript">
yepnope([{ test: window.jQuery, nope: '/ravendb/profiling?path=jquery-1.6.1.min.js' }, { test: window.jQuery && window.jQuery.fn.tmpl, nope: '/ravendb/profiling?path=jquery.tmpl.min.js' }, {load: '/ravendb/profiling?path=ravendb-profiler-scripts.js', complete: function() { jQuery(function() { RavenDBProfiler.initalize({ id:['df05238a-24a6-4a16-ad63-3b9537e9b544'], url: '/ravendb/profiling' }); }) } }]);
</script>

The subsequent loads contain:

<script type="text/javascript">
yepnope([{ test: window.jQuery, nope: '/ravendb/profiling?path=jquery-1.6.1.min.js' }, { test: window.jQuery && window.jQuery.fn.tmpl, nope: '/ravendb/profiling?path=jquery.tmpl.min.js' }, {load: '/ravendb/profiling?path=ravendb-profiler-scripts.js', complete: function() { jQuery(function() { RavenDBProfiler.initalize({ id:[], url: '/ravendb/profiling' }); }) } }]);
</script>

Note the lack of id objects.

I’ve also tried the mini-profiler and I have also tried rolling back from the latest unstable RavenDb client to the current stable release. Nothing appears to make a difference.

Is this the expected behavior? Do I need to do anything else? Am I being an idiot here?

Update

I’ve just installed the Glimpse.Ravendb plugin and it reports:

Profiling is currently not supported for EmbeddableDocumentStore.

However, I’m clearly not using the EmbeddableDocumentStore:

public static class DocumentStoreFactory
{
    public static IDocumentStore Create(string connectionStringName)
    {
        var documentStore = new DocumentStore { ConnectionStringName = connectionStringName };
        documentStore.Initialize();
        documentStore.DatabaseCommands.EnsureDatabaseExists(connectionStringName);

        var catalog = new CompositionContainer(new AssemblyCatalog(typeof(Users_ByKarmaAndLocation).Assembly));
        IndexCreation.CreateIndexes(catalog, documentStore.DatabaseCommands.ForDatabase(connectionStringName), documentStore.Conventions);

        return documentStore;
    }
}

I’m not sure if this is a red herring or not. Thought I would mention it though.

  • 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-11T01:22:05+00:00Added an answer on June 11, 2026 at 1:22 am

    The problem was my Unity setup. I should not have used a Unity HierarchicalLifetimeManager() but a PerResolveLifetimeManager(). The Glimpse problem resolved once I had restarted the application.

    With hindsight, I should have paid closer attention to the different types of LifetimeContainers and used them properly.

    The updated Unity config looks like this:

    public static class AppStart_Unity
    {
        public static void RegisterServices(IUnityContainer container)
        {
            container.RegisterInstance(DocumentStoreFactory.Create(ConfigurationManager.ConnectionStrings[0].Name));
            //container.RegisterType<IDocumentSession>(new HierarchicalLifetimeManager(), new InjectionFactory(c => c.Resolve<IDocumentStore>().OpenSession(ConfigurationManager.ConnectionStrings[0].Name)));
            container.RegisterType<IDocumentSession>(new PerResolveLifetimeManager(), new InjectionFactory(c => c.Resolve<IDocumentStore>().OpenSession()));
        }
    
        public static void Start()
        {
            // Create the unity container
            IUnityContainer container = new UnityContainer();
    
            // Register services with our Unity container
            RegisterServices(container);
    
            // Tell ASP.NET MVC to use our Unity DI container
            DependencyResolver.SetResolver(new UnityServiceLocator(container));
    
            var store = container.Resolve<IDocumentStore>();
            var documentStore = store as DocumentStore;
            if (documentStore == null)
            {
                return;
            }
    
            RavenProfiler.InitializeFor(
                documentStore,
                "Email", "HashedPassword", "AkismetKey", "PasswordSalt", "UserHostAddress");
            Profiler.AttachTo(documentStore);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:

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.