You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTML logger LogFilePrefix collides with multiple projects during dotnet test #15074
When running dotnet test solution.sln --logger:`"html;LogFilePrefix=<absolutepath>/tests/html/tests_results on a solution with multiple test projects I frequently get an error like this:
Html Logger Error : The process cannot access the file 'C:\git\project\artifacts\support\tests\tests\html\tests_results_net8.0_20250522131609.html' because it is being used by another process.
It seems multiple dotnet.exe are used to execute tests in parallel and some end up with the same timestamp in the filename
Process monitor shows the SHARING_VIOLATION occurs when a second dotnet.exe process tries to create a file during the same second as the first entry in the screenshot.
Not shown: actually there are 4 dotnet exe's all trying to create the same file but I filtered the other 2 out for simplicity.
Seems that timestemp should be extended to include fractional seconds? Or better yet use the assembly name of the test project in the filename too? Nunit supports {assembly} and {framework} substitutions in its filename parameter which is nice but that would be more helpful in the LogFileName parameter of HTML logger.
Ideally this would be solved by templates in the file name like .html, but we don't have that and we are not adding new features here.
#5132 (comment) you could probably work around this by setting the report name based on the project directly from the project file, using the variables you have there.
I've also just found that I'm affected by this unfortunately. Glen Nicol (@glen-nicol): Did you happen to try the suggested workaround with any success?
I don't remember if I tried it or not but I ended up removing the html logger argument and then I used the jenkins nunit plugin to format the nunit xml file for CI jobs. No local html file but I imagine I could hook up some nunit report generator if I really needed to.
Activity
nohwnd commentedon May 23, 2025
Ideally this would be solved by templates in the file name like .html, but we don't have that and we are not adding new features here.
#5132 (comment) you could probably work around this by setting the report name based on the project directly from the project file, using the variables you have there.
glen-nicol commentedon May 23, 2025
Got it, I will try that. Thanks!
nohwnd commentedon Jun 12, 2025
This would require a new feature and has a known workaround, closing.
christopher-watanabe-snkeos commentedon Mar 17, 2026
I've also just found that I'm affected by this unfortunately. Glen Nicol (@glen-nicol): Did you happen to try the suggested workaround with any success?
glen-nicol commentedon Mar 17, 2026
I don't remember if I tried it or not but I ended up removing the html logger argument and then I used the jenkins nunit plugin to format the nunit xml file for CI jobs. No local html file but I imagine I could hook up some nunit report generator if I really needed to.