Skip to content

Commit 7ebed03

Browse files
Disable file watching for the Bicep linter config file (#3044)
1 parent 5b6a63b commit 7ebed03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Bicep.Core/Configuration/ConfigHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ private IConfigurationRoot BuildConfig(string? localFolder)
5050
// last added json settings take precedent - add local settings last
5151
if (DiscoverLocalConfigurationFile(localFolder) is string localConfig)
5252
{
53-
configBuilder.AddJsonFile(localConfig, true, true);
53+
// we must set reloadOnChange to false here - if it set to true, then ConfigurationBuilder will initialize
54+
// a FileSystem.Watcher instance - which has severe performance impact on non-Windows OSes (https://github.com/dotnet/runtime/issues/42036)
55+
configBuilder.AddJsonFile(localConfig, optional: true, reloadOnChange: false);
5456
this.CustomSettingsFileName = localConfig;
5557
}
5658
else

0 commit comments

Comments
 (0)