Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

nCrunchTemp_* directories in weird place, and not being cleaned up
rwv37
#1 Posted : Tuesday, October 12, 2021 8:44:11 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/1/2019(UTC)
Posts: 11
Location: United States of America

I just changed a *.csproj file to generate the XML documentation in a Docs folder tree under the main solution directory:

<PropertyGroup>
<Rwv37SolutionDirectory>$(MSBuildProjectDirectory)\..</Rwv37SolutionDirectory>
<Rwv37SolutionDocsDirectory>$(Rwv37SolutionDirectory)\Docs</Rwv37SolutionDocsDirectory>
<Rwv37ProjectDocsDirectory>$(Rwv37SolutionDocsDirectory)\$(MSBuildProjectName)</Rwv37ProjectDocsDirectory>
<DocumentationFile>$(Rwv37ProjectDocsDirectory)\$(MSBuildProjectName).xml</DocumentationFile>
</PropertyGroup>


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, Core.xml is generated in the Docs\Core 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 nCrunchTemp_* directory is created within Docs. 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 Docs directory now contains:

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


None of the nCrunchTemp_* 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.
rwv37
#2 Posted : Tuesday, October 12, 2021 10:09:36 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/1/2019(UTC)
Posts: 11
Location: United States of America

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
#3 Posted : Wednesday, October 13, 2021 4:03:11 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
rwv37
#4 Posted : Thursday, October 14, 2021 11:17:09 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/1/2019(UTC)
Posts: 11
Location: United States of America

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):


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


NCrunch solution file (NCrunchTempDir.v3.ncrunchsolution):


<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>False</AllowParallelTestExecution>
<SolutionConfigured>True</SolutionConfigured>
</Settings>
</SolutionConfiguration>


NCrunch solution user file (NCrunchTempDir.v3.ncrunchsolution.user):


<SolutionConfiguration>
<Settings>
<AutoEnable>True</AutoEnable>
<CurrentEngineMode>Run all tests automatically [Global]</CurrentEngineMode>
<TestsWindowSplitterDistance>49.8945159912109%</TestsWindowSplitterDistance>
</Settings>
</SolutionConfiguration>


Project file (NCrunchTempDir/NCrunchTempDir.csproj):


<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>


Class file:


namespace NCrunchTempDir
{
using System;

public class Class1
{
}
}


I hope this helps. Thanks again.
Remco
#5 Posted : Thursday, October 14, 2021 11:31:22 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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>
rwv37
#6 Posted : Thursday, October 14, 2021 11:50:27 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/1/2019(UTC)
Posts: 11
Location: United States of America

Just tried that; the same thing happens.
rwv37
#7 Posted : Thursday, October 14, 2021 11:59:30 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/1/2019(UTC)
Posts: 11
Location: United States of America

Poked around a little more, and found:

(1) If I take the GenerateDocumentationFile property out completely, it still happens.

(2) However, if I put it back in and explicitly set it to false, it does not happen.
Remco
#8 Posted : Friday, October 15, 2021 2:48:03 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
rwv37;15713 wrote:

(2) However, if I put it back in and explicitly set it to false, 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>
rwv37
#9 Posted : Friday, October 15, 2021 3:08:28 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/1/2019(UTC)
Posts: 11
Location: United States of America

That (the PropertyGroup Condition one) seems to have done the trick. Thank you!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.064 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download