Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO access error when using the file system tracer #862

Closed
tusmester opened this issue Jan 14, 2020 · 0 comments
Closed

IO access error when using the file system tracer #862

tusmester opened this issue Jan 14, 2020 · 0 comments
Assignees
Milestone

Comments

@tusmester
Copy link
Member

When using the file system tracer in an asp.net core web application, this exception is thrown:

The process cannot access the file '...\App_Data\DetailedLog\detailedlog_20200114-141132Z.log' because it is being used by another process.

  at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamWriter..ctor(String path, Boolean append)
   at SenseNet.Diagnostics.SnFileSystemTracer.WriteBatch(String text) in D:\Dev\github\sn-tools\src\SenseNet.Tools\Diagnostics\SnFileSystemTracer.cs:line 64

To use the tracer, add this line to the repo building code:

var repositoryBuilder = new RepositoryBuilder()    
    .UseTracer(new SnFileSystemTracer())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants