If this is a build issue with your project then it sounds like you're solving the problem the wrong way. The functionality you mention is part of one of the NuGet packages you will have installed as part of your project. Please provide us information about your project including:
- Confirmation of where the error is occurring (starting VS, compiling your code, etc)
- What type of project you have (e.g. Winforms, ASP.NET Core)
- What framework version you are using (e.g. NET 8, NET 10)
- What NuGet packages your project is referencing
- You said it works for a while and then stops, what changed between the last time it works and when it stops working
The particular functionality you are having an issue with is contained in the `Microsoft.Extensions.Configuration.FileExtensions which is generally indirectly referenced by one of the other core packages you are using. But without project information it is hard to say.