dotMemory fails to profile windows service

I have a windows service, which internally hosts a website using cassini dev web server.

Dot Memory starts profiling but after 10-15 seconds stops with an error message "Unexpected Service state stopped".

I checked the event viewer for possible errors. Found that somehow, when dot memory starts profiling, Ninject(DI Lib) cant bind dependencies.

Service.exe Framework Version: v4.0.30319 Description: The application requested process termination through System.Environment.FailFast(string message). 
0
2 comments
Official comment

Hi!
A similar problem with Ninject was reported once, but unfortunately the investigation was not completed. Could you please join this issue tracker ticket or provide us with a small reproducible example which allows us to reproduce a problem on our side here?

I get this error, hope this helps to reproduce bug.

Ninject version : 3.2.2.0

Ninject.Web.Common version : 3.2.3.0

WebActivatorEx version : 2.0.6

Stack:
   at System.Environment.FailFast(System.String)
   at <Module>.‎‫
‭‬

‮​‍​‬‍‭​‎‏‭‌‭‫‌‮‬‎‬‫‎‭‏‮()
   at <Module>..cctor()
   at ExtractionManager.IoC.NinjectExtractionManagerModules+MainExtractionManagerModule.Load()
   at Ninject.Modules.NinjectModule.OnLoad(Ninject.IKernel)
   at Ninject.KernelBase.Load(System.Collections.Generic.IEnumerable`1<Ninject.Modules.INinjectModule>)
   at ClinicWebsite.App_Start.NinjectWeb.Start()
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at WebActivatorEx.BaseActivationMethodAttribute.InvokeMethod()
   at WebActivatorEx.ActivationManager.RunActivationMethods[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Boolean)
   at WebActivatorEx.ActivationManager.Run()
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(System.Collections.Generic.ICollection`1<System.Reflection.MethodInfo>, System.Func`1<System.IDisposable>)
   at System.Web.Compilation.BuildManager.InvokePreStartInitMethods(System.Collections.Generic.ICollection`1<System.Reflection.MethodInfo>)
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(System.String, Boolean ByRef)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager, System.Web.Hosting.IApplicationHost, System.Web.Configuration.IConfigMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters, System.Security.Policy.PolicyLevel, System.Exception)
   at System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager, System.Web.Hosting.IApplicationHost, System.Web.Configuration.IConfigMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters, System.Security.Policy.PolicyLevel)
   at System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager, System.Web.Hosting.IApplicationHost, System.Web.Configuration.IConfigMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters, System.Security.Policy.PolicyLevel)
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
   at System.Web.Hosting.ApplicationManager.GetAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
   at System.Web.Hosting.ApplicationManager.CreateObjectInternal(System.String, System.Type, System.Web.Hosting.IApplicationHost, Boolean, System.Web.Hosting.HostingEnvironmentParameters)
   at System.Web.Hosting.ApplicationManager.CreateObject(System.String, System.Type, System.String, System.String, Boolean, Boolean)
   at System.Web.Hosting.ApplicationManager.CreateObject(System.String, System.Type, System.String, System.String, Boolean)
   at CassiniDev.Server.CreateWorkerAppDomainWithHost(System.String, System.String, System.Type, Int32)
   at CassiniDev.Server.GetHost()
   at CassiniDev.Server+<>c__DisplayClass2.<Start>b__1(System.Object)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
0

Please sign in to leave a comment.