dotnet / dotnet/winforms

VB FileLogTraceListerner creates Application.UserAppDataPath whether it's needed or not

Open
#9,154 1 comment 0 reactions 1 assignee Assigned to @KlausLoeffelmann View on GitHub
area-VisualBasic priority-3
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### .NET version

All versions

### Did it work in .NET Framework?

No

### Did it work in any of the earlier releases of .NET Core or .NET 5+?

no

### Issue description

Since a reference to Application.UserAppDataPath creates its directory if needed, the initialization of _CustomLocation in FileLogTraceListener also does so, even if that is not the intended destination for the log file(s). It would be better to move that initialization to the Get clause of the CustomLocation property.

### Steps to reproduce

Any creation of a FileLogTraceListener object in Visual Basic creates the directory.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.