Prohibited environment variable name COR_PROFILER

I'm getting this error when I run the CoverUnit Test, however I'm able to run the Unit tests without any issue.

------------------------------------------------------------ 
Failed to start profiling: Unable to start profiling. 
Prohibited environment variable name COR_PROFILER.

---------------------------------------------------------------------------- 
Error From Log

--- EXCEPTION #1/2 [ApplicationException] 
Message = “Prohibited environment variable name COR_PROFILER” 
ExceptionPath = Root.InnerException 
ClassName = System.ApplicationException 
HResult = COR_E_APPLICATION=80131600 
Source = JetBrains.Profiler.Windows.SysTools 
StackTraceString = “ 
at JetBrains.Profiler.Windows.SysTools.Tools.VariableUtil.MakeProfileEnvironment(ClrEngine clrEngine, IArgument argument, String hostEndPoint, String remoteEndPoint, Nullable`1 logMask, String tempPath, CoreDebug coreDebug, IDictionary`2 additionalEnvironmentVariables, IntegrationCoreInfo integrationCoreInfo, IDictionary`2 clrProfilerDlls, IDictionary`2 monoProfilerDlls) 
at JetBrains.Profiler.Windows.Impl.HostParameters.BaseHost.<>c__DisplayClass29_0.<Profile>g__Deploy|14(Lifetime profilingLifetime, IProgressIndicator progressIndicator, InstructionSet[] instructionSets, ClrEngine clrEngine, ProfilerActivationFlags profilerActivationFlags, IHostUI ui) 
at JetBrains.Profiler.Windows.Impl.HostProfile.BaseHostProfile.<>c__DisplayClass45_0.<JetBrains.Profiler.Profile.IHostProfileSubscription.Start>b__1(InstructionSet[] x, ClrEngine y, ProfilerActivationFlags z) 
at JetBrains.Profiler.Windows.Impl.HostProfile.StandaloneHostProfile.OnStart(InternalHostProfileParam param) 
at JetBrains.Profiler.Windows.Impl.HostProfile.BaseHostProfile.JetBrains.Profiler.Profile.IHostProfileSubscription.Start(IProgressIndicator progressIndicator, IHostUI ui) 

--- Outer ---

--- EXCEPTION #2/2 [LoggerException] 
Message = “Prohibited environment variable name COR_PROFILER” 
ExceptionPath = Root 
ClassName = JetBrains.Util.LoggerException 
InnerException = “Exception #1 at Root.InnerException” 
HResult = COR_E_APPLICATION=80131600 
StackTraceString = “ 
at JetBrains.Profiler.Windows.Impl.HostProfile.BaseHostProfile.JetBrains.Profiler.Profile.IHostProfileSubscription.Start(IProgressIndicator progressIndicator, IHostUI ui) 
at JetBrains.Profiler.Launcher.LauncherController.<>c__DisplayClass1_0.<RunProfiler>b__1() 
at JetBrains.Profiler.Launcher.LauncherController.Rethrow[TResult](Func`1 failMessage, Func`1 func) 
at JetBrains.Profiler.Launcher.LauncherController.RunProfiler(ProfileConfiguration configuration, Lifetime lifetime, IHostManager hostManager, IProgressIndicator connectingProgress, Func`2 eventSubscriptionCallback) 
at JetBrains.ProfilingInstance.ProfilingInstance..ctor(ProfileConfiguration configuration, IHostManager hostManager, IHostUI hostUI, IThreading threading, IProgressIndicator progressIndicator, IEnumerable`1 customProfilingViewers) 
at JetBrains.ProfilingInstance.MeasureProfilingInstance..ctor(ProfileConfiguration configuration, Boolean isAttach, IHostManager hostManager, IHostUI hostUI, IThreading threading, IProgressIndicator progressIndicator, IProfilerResultsHandler profilerResultsHandler, ICustomProfilingViewer[] customProfilingViewersArray) 
at JetBrains.dotCover.ClientCore.ProfilerLauncher.Model.ProfilerLauncher.StartProfiling(ICoverageConfiguration configuration, IProfilerResultsHandler profilerResultsHandler, ICustomProfilingViewer customProfilingViewer, IHostUI hostUI) 
at JetBrains.dotCover.Ide.Core.UnitTesting.Model.HostProvider.CoverageTaskRunnerHostController.<>c__DisplayClass23_0.<StartTaskRunnerProfiling>b__1(Task`1 t) 
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() 
at System.Threading.Tasks.Task.Execute() 
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj) 
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) 
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) 
at System.Threading.Tasks.TaskScheduler.TryExecuteTask(Task task) 
at JetBrains.Application.Threading.Tasks.Scheduler.JetScheduler.ExecuteTask(Task task) 
at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.EnqueueNextTask() 
at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.ThreadPoolProc() 
at ANNOTATED: JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread #1.JetPool(S) #4(Action ) 
at JetBrains.Util.Reflection.CallStackAnnotation.InvokeAnnotated(String classNameOfNewFrame, String methodNameOfNewFrame, Action actionToAnnotate) 
at JetBrains.Util.Reflection.CallStackAnnotation.CatchAnnotatedInvocation[TClassOfNewFrame](String methodNameOfNewFrame, Action actionToAnnotate) 
at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.<Start>b__20_0() 
at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
at System.Threading.ThreadHelper.ThreadStart() 

4
2 comments

Also happening in Profile Current Session, this may be the root cause for failing in unit test coverage shown in this report.

1

I've had the same problem when MS Fakes is being used.

0

Please sign in to leave a comment.