Skip to content

Accountant: " The process cannot access the file..." exception #2

@nvsnkv

Description

@nvsnkv

An attempt to read file which is opened in Excel leads to IOException

Unhandled exception. System.IO.IOException: The process cannot access the file 'input.csv' because it is being used by another process.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.File.OpenRead(String path)
   at Flow.Hosts.Common.Commands.CommandBase.CreateReader(String input) in C:\Users\nvsnk\sources\repos\flow2\src\l3\CommandLine\Flow.Hosts.Common\Commands\CommandBase.cs:line 58
   at Flow.Hosts.Accountant.Cli.Commands.EditTransactionsCommand.Execute(AddTransactionsArgs args, CancellationToken ct) in C:\Users\nvsnk\sources\repos\flow2\src\l3\CommandLine\Flow.Hosts.Accountant.Cli\Commands\EditTransactionsCommand.cs:line 34
   at Program.<>c__DisplayClass0_0.<<<Main>$>b__0>d.MoveNext() in C:\Users\nvsnk\sources\repos\flow2\src\l3\CommandLine\Flow.Hosts.Accountant.Cli\Program.cs:line 33
--- End of stack trace from previous location ---
   at Program.<Main>$(String[] args) in C:\Users\nvsnk\sources\repos\flow2\src\l3\CommandLine\Flow.Hosts.Accountant.Cli\Program.cs:line 32
   at Program.<Main>(String[] args)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions