-
Notifications
You must be signed in to change notification settings - Fork 391
Closed
Labels
Priority:0Critical to the releaseCritical to the releaseblocking-usersIssue is blocking some usersIssue is blocking some userstracking-external-issueThe issue is caused by external problem - nothing we can do to fix it directlyThe issue is caused by external problem - nothing we can do to fix it directly
Description
After figuring out why CoreLib doesn't write the result file when being instrumented by coverlet and working around the issue, I noticed that the WriteLog and WriteHits methods in the ModuleTrackerTemplate throw:
Unhandled exception. System.TypeLoadException: Could not load type 'System.Diagnostics.Process' from assembly 'System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
at Coverlet.Core.Instrumentation.Tracker.System.Private.CoreLib_19e73ecb-b988-441a-913d-54373b41abc8.WriteLog(String)
at Coverlet.Core.Instrumentation.Tracker.System.Private.CoreLib_19e73ecb-b988-441a-913d-54373b41abc8.UnloadModule(Object, EventArgs)
at System.AppContext.OnProcessExit() in C:\git\runtime3\src\libraries\System.Private.CoreLib\src\System\AppContext.cs:line 88
string logFile = Path.Combine(location.FullName, $"{Path.GetFileName(currentAssembly.Location)}_{DateTime.UtcNow.Ticks}_{Process.GetCurrentProcess().Id}.txt"); File.AppendAllText(Path.Combine(Path.GetDirectoryName(location), Path.GetFileName(location) + "_tracker.txt"), $"[{DateTime.UtcNow} P:{Process.GetCurrentProcess().Id} T:{Thread.CurrentThread.ManagedThreadId}]{logText}{Environment.NewLine}");
That's because CoreLib doesn't have access to the Process type and even though those code paths aren't running by default, they are in the IL and hence the types are tried to be resolved. To unblock dotnet/runtime it would be great if these code paths that rely on Process could be changed to not include the process id.
cc @stephentoub
Metadata
Metadata
Assignees
Labels
Priority:0Critical to the releaseCritical to the releaseblocking-usersIssue is blocking some usersIssue is blocking some userstracking-external-issueThe issue is caused by external problem - nothing we can do to fix it directlyThe issue is caused by external problem - nothing we can do to fix it directly