I just changed a [h]*.csproj[/h] file to generate the XML documentation in a [h]Docs[/h] folder tree under the main solution directory:
[h]<PropertyGroup>
<Rwv37SolutionDirectory>$(MSBuildProjectDirectory)\..</Rwv37SolutionDirectory>
<Rwv37SolutionDocsDirectory>$(Rwv37SolutionDirectory)\Docs</Rwv37SolutionDocsDirectory>
<Rwv37ProjectDocsDirectory>$(Rwv37SolutionDocsDirectory)\$(MSBuildProjectName)</Rwv37ProjectDocsDirectory>
<DocumentationFile>$(Rwv37ProjectDocsDirectory)\$(MSBuildProjectName).xml</DocumentationFile>
</PropertyGroup>
[/h]
That's working fine insofar as the documentation files are generated in the place I want them to be. So, for example for the "Core" project, [h]Core.xml[/h] is generated in the [h]Docs\Core[/h] directory, which itself is directly in the solution directory (i.e. a level up from the project directory).
However, every time I open the solution in VS, a new [h]nCrunchTemp_*[/h] directory is created within [h]Docs[/h]. The directory is empty, and seemingly never gets deleted without manual intervention. So, for example, I just cleaned it all up manually, then opened/closed the solution three times. The [h]Docs[/h] directory now contains:
[h]d---- 10/12/2021 4:15 PM Core
d---- 10/12/2021 4:31 PM nCrunchTemp_0061d108-8910-4b78-9fd1-05add17c0cef
d---- 10/12/2021 4:20 PM nCrunchTemp_827aef2c-59fb-4989-a0a2-71d100c3ae14
d---- 10/12/2021 4:23 PM nCrunchTemp_cecd3a7f-524e-435b-9dae-9bc4146610bb
[/h]
None of the [h]nCrunchTemp_*[/h] directories have anything in them, and as far as I can tell they will never go away unless I manually delete them. And the next time I open the solution, a fourth will be created.
I am using VS 2019 16.11.2 and NCrunch 4.9.0.8.
Why would NCrunch be creating these directories there? Why don't they ever get cleaned up? Can I do something to have them automatically cleaned up? Or, preferably, to not be put there in the first place? Thanks.
Daily Usage Issues
nCrunchTemp_* directories in weird place, and not being cleaned up
Started by rwv37 on 3,132 views
Oh, I should probably say that the only thing I've done in this solution with NCrunch so far is to have it turned on. I don't even have any tests written yet. There's only one project (a C# library), which is really, really close to being nothing at all.
Remco NCrunch Developer
#15699
13 Oct 2021 04:03 UTC
Hi, thanks for sharing this issue.
When NCrunch loads the project, it creates a renamed clone of the project with some minor modifications.
My expectation here is that you're using a package or toolset that is taking the name of the project and using this to generate files when at least part of the build for the project is done.
Can you tell me more about the project involved and whether you have any 3rd party packages installed in it? If you can share the project XML with me, this would be ideal.
When NCrunch loads the project, it creates a renamed clone of the project with some minor modifications.
My expectation here is that you're using a package or toolset that is taking the name of the project and using this to generate files when at least part of the build for the project is done.
Can you tell me more about the project involved and whether you have any 3rd party packages installed in it? If you can share the project XML with me, this would be ideal.
Thanks.
The project/solution has gotten more complicated since my original post, so I started over to get something that must be at least close to a minimal case (which I'll include in this post). I do have a couple other tools installed in VS -- GhostDoc Pro and NDepend. I have no NDepend project attached or opened to the probably-near-minimal case's solution. I have no NuGet packages installed in it. I'm not sure if there's anything besides those that you might mean by "package or toolset", so if there might be, or if there's any other information you'd like me to try to provide, please let me know.
I don't see how to attach files in this forum, so I'll just copy/paste theme here.
Solution file (NCrunchTempDir.sln):
[h]
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31624.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NCrunchTempDir", "NCrunchTempDir\NCrunchTempDir.csproj", "{77B6723D-9047-466F-9C57-9A8130E6483D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{77B6723D-9047-466F-9C57-9A8130E6483D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77B6723D-9047-466F-9C57-9A8130E6483D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77B6723D-9047-466F-9C57-9A8130E6483D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77B6723D-9047-466F-9C57-9A8130E6483D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1CCEF215-236A-4FCA-A266-5CFF0CD59FFC}
EndGlobalSection
EndGlobal
[/h]
NCrunch solution file (NCrunchTempDir.v3.ncrunchsolution):
[h]
<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>False</AllowParallelTestExecution>
<SolutionConfigured>True</SolutionConfigured>
</Settings>
</SolutionConfiguration>
[/h]
NCrunch solution user file (NCrunchTempDir.v3.ncrunchsolution.user):
[h]
<SolutionConfiguration>
<Settings>
<AutoEnable>True</AutoEnable>
<CurrentEngineMode>Run all tests automatically [Global]</CurrentEngineMode>
<TestsWindowSplitterDistance>49.8945159912109%</TestsWindowSplitterDistance>
</Settings>
</SolutionConfiguration>
[/h]
Project file (NCrunchTempDir/NCrunchTempDir.csproj):
[h]
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Rwv37SolutionDirectory>$(MSBuildProjectDirectory)\..</Rwv37SolutionDirectory>
<Rwv37SolutionDocsDirectory>$(Rwv37SolutionDirectory)\Docs</Rwv37SolutionDocsDirectory>
<Rwv37ProjectDocsDirectory>$(Rwv37SolutionDocsDirectory)\$(MSBuildProjectName)</Rwv37ProjectDocsDirectory>
</PropertyGroup>
<PropertyGroup>
<DocumentationFile>$(Rwv37ProjectDocsDirectory)\$(MSBuildProjectName).xml</DocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
[/h]
Class file:
[h]
namespace NCrunchTempDir
{
using System;
public class Class1
{
}
}
[/h]
I hope this helps. Thanks again.
The project/solution has gotten more complicated since my original post, so I started over to get something that must be at least close to a minimal case (which I'll include in this post). I do have a couple other tools installed in VS -- GhostDoc Pro and NDepend. I have no NDepend project attached or opened to the probably-near-minimal case's solution. I have no NuGet packages installed in it. I'm not sure if there's anything besides those that you might mean by "package or toolset", so if there might be, or if there's any other information you'd like me to try to provide, please let me know.
I don't see how to attach files in this forum, so I'll just copy/paste theme here.
Solution file (NCrunchTempDir.sln):
[h]
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31624.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NCrunchTempDir", "NCrunchTempDir\NCrunchTempDir.csproj", "{77B6723D-9047-466F-9C57-9A8130E6483D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{77B6723D-9047-466F-9C57-9A8130E6483D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77B6723D-9047-466F-9C57-9A8130E6483D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77B6723D-9047-466F-9C57-9A8130E6483D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77B6723D-9047-466F-9C57-9A8130E6483D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1CCEF215-236A-4FCA-A266-5CFF0CD59FFC}
EndGlobalSection
EndGlobal
[/h]
NCrunch solution file (NCrunchTempDir.v3.ncrunchsolution):
[h]
<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>False</AllowParallelTestExecution>
<SolutionConfigured>True</SolutionConfigured>
</Settings>
</SolutionConfiguration>
[/h]
NCrunch solution user file (NCrunchTempDir.v3.ncrunchsolution.user):
[h]
<SolutionConfiguration>
<Settings>
<AutoEnable>True</AutoEnable>
<CurrentEngineMode>Run all tests automatically [Global]</CurrentEngineMode>
<TestsWindowSplitterDistance>49.8945159912109%</TestsWindowSplitterDistance>
</Settings>
</SolutionConfiguration>
[/h]
Project file (NCrunchTempDir/NCrunchTempDir.csproj):
[h]
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Rwv37SolutionDirectory>$(MSBuildProjectDirectory)\..</Rwv37SolutionDirectory>
<Rwv37SolutionDocsDirectory>$(Rwv37SolutionDirectory)\Docs</Rwv37SolutionDocsDirectory>
<Rwv37ProjectDocsDirectory>$(Rwv37SolutionDocsDirectory)\$(MSBuildProjectName)</Rwv37ProjectDocsDirectory>
</PropertyGroup>
<PropertyGroup>
<DocumentationFile>$(Rwv37ProjectDocsDirectory)\$(MSBuildProjectName).xml</DocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
[/h]
Class file:
[h]
namespace NCrunchTempDir
{
using System;
public class Class1
{
}
}
[/h]
I hope this helps. Thanks again.
Remco NCrunch Developer
#15711
14 Oct 2021 23:31 UTC
Thanks for these details. Could you try making the 'GenerateDocumentationFile' property conditional inside its own PropertyGroup to see if this solves the problem? Example below:
<PropertyGroup Condition="'$(NCrunch)' != '1'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(NCrunch)' != '1'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
Edited 14 Oct 2021 23:31 UTC
Just tried that; the same thing happens.
Poked around a little more, and found:
(1) If I take the [h]GenerateDocumentationFile[/h] property out completely, it still happens.
(2) However, if I put it back in and explicitly set it to [h]false[/h], it does not happen.
(1) If I take the [h]GenerateDocumentationFile[/h] property out completely, it still happens.
(2) However, if I put it back in and explicitly set it to [h]false[/h], it does not happen.
Edited 15 Oct 2021 00:00 UTC
Remco NCrunch Developer
#15714
15 Oct 2021 02:48 UTC
rwv37 wrote:
(2) However, if I put it back in and explicitly set it to [h]false[/h], it does not happen.
Nice work :)
In this case, we can try the following:
<PropertyGroup Condition="'$(NCrunch)' != '1'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(NCrunch)' == '1'">
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
Another thing to try is to avoid using the project name in the documentation path, and to use the assembly name instead. For example:
<Rwv37ProjectDocsDirectory>$(Rwv37SolutionDocsDirectory)\$(AssemblyName)</Rwv37ProjectDocsDirectory>
Edited 15 Oct 2021 02:50 UTC
That (the PropertyGroup Condition one) seems to have done the trick. Thank you!
Post a reply
Log in to reply.