Skip to content

temp file gets deleted, handle case #137

Open

Description

@BenjaminMichaelis

image

Logs:

System. TypeInitializationException : The type initializer for
'IntelliTect.Multitool.RepositoryPaths' threw an exception.
System. IO. FileNotFoundException : Could not find file 'C: \U
\IntelliTect.MultiTool.BuildVariables.tmp'.

This exception was originally thrown at this call stack:
    Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions)
    Microsoft.Win32.SafeHandles.SafeFileHandle.Open(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions, long, System.IO.UnixFileMode?)
    System.IO.Strategies.OSFileStreamStrategy.OSFileStreamStrategy(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions, long, System.IO.UnixFileMode?)
    System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions, long, System.IO.UnixFileMode?)
    System.IO.StreamReader.ValidateArgsAndOpenPath(string, System.Text.Encoding, int)
    System.IO.File.ReadAllLines(string, System.Text.Encoding)
    IntelliTect.Multitool.RepositoryPaths.RepositoryPaths()

Possible repro steps:

  • Project sat idle for a week or two without any work on it, project remained closed
  • various Windows stuff happened that ultimately purged that temp file
  • I open the project back up and run the tests, function doesn't work anymore

Investigate if the file isn't there as expected, handling that case.

Activity

  1. BenjaminMichaelis commented on Jan 4, 2026

    @BenjaminMichaelis
    MemberAuthor

    System.TypeInitializationException: 'The type initializer for 'IntelliTect.Multitool.RepositoryPaths' threw an exception.'
    FileNotFoundException: Could not find file 'C:\Users\Test\AppData\Local\Temp\IntelliTect.MultiTool.BuildVariables.tmp'.

    [System.TypeInitializationException user-unhandled]
    IntelliTect.Multitool.dll!IntelliTect.Multitool.RepositoryPaths.BuildVariables.get()
    IntelliTect.Multitool.dll!IntelliTect.Multitool.RepositoryPaths.GetDefaultRepoRoot()
    ScriptTester.dll!ScriptTester.Services.ConfigurationService.LoadConfig() Line 14
    	at D:\ScriptTester\ScriptTester\Services\ConfigurationService.cs(14)
    ScriptTester.dll!ScriptTester.Program.Main(string[] args) Line 19
    	at D:\ScriptTester\ScriptTester\Program.cs(19)
    ScriptTester.dll!ScriptTester.Program.<Main>(string[] args)
    
    System.TypeInitializationException
      HResult=0x80131534
      Message=The type initializer for 'IntelliTect.Multitool.RepositoryPaths' threw an exception.
      Source=IntelliTect.Multitool
      StackTrace:
       at IntelliTect.Multitool.RepositoryPaths.get_BuildVariables()
       at IntelliTect.Multitool.RepositoryPaths.GetDefaultRepoRoot()
       at ScriptTester.Services.ConfigurationService.LoadConfig() in D:\ScriptTester\ScriptTester\Services\ConfigurationService.cs:line 14
       at ScriptTester.Program.<Main>d__14.MoveNext() in D:\ScriptTester\ScriptTester\Program.cs:line 19
    
      This exception was originally thrown at this call stack:
        Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions)
        Microsoft.Win32.SafeHandles.SafeFileHandle.Open(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions, long, System.IO.UnixFileMode?)
        System.IO.Strategies.OSFileStreamStrategy.OSFileStreamStrategy(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions, long, System.IO.UnixFileMode?)
        System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.IO.FileOptions, long, System.IO.UnixFileMode?)
        System.IO.StreamReader.ValidateArgsAndOpenPath(string, System.Text.Encoding, int)
        System.IO.File.ReadAllLines(string, System.Text.Encoding)
        IntelliTect.Multitool.RepositoryPaths.RepositoryPaths()
    
    Inner Exception 1:
    FileNotFoundException: Could not find file 'C:\Users\Test\AppData\Local\Temp\IntelliTect.MultiTool.BuildVariables.tmp'.
    
  2. BenjaminMichaelis commented on May 22, 2026

    @BenjaminMichaelis
    MemberAuthor

    #199 may help by derivation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions