技术疑问:SlowCheetah确定转换配置的读取位置及异常问题
Great question! I’ve run into this exact quirk with SlowCheetah before, so let me break down where it might be pulling these configuration names from:
Built-in recognition of standard .NET configurations
Debug and Release are the default, standardized configuration names in the .NET ecosystem. SlowCheetah has hardcoded logic to recognize these two as "default" options, even if you remove them from the Build > Configuration Manager. It treats them as fallback configurations when generating transforms, unless you explicitly override this behavior.Residual configuration entries in your .csproj file
When you delete configurations via the Configuration Manager, Visual Studio doesn’t always clean up every trace in the underlying project file. Open your.csprojfile in a text editor and search forDebugorRelease—you might find leftover entries like:<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <!-- Debug-specific settings --> </PropertyGroup>Or references to existing transform files (like
<None Include="appsettings.Debug.json" />). SlowCheetah scans the project file for these references and uses them to determine which transforms to generate.Previous transform file traces
If you’ve already generatedappsettings.Debug.jsonorappsettings.Release.jsonin the past, even if you delete the files themselves, SlowCheetah might retain metadata about them in the project file. This can trigger it to regenerate the files when you click "Add Transform" again.
How to Fix This
To get SlowCheetah to only generate transforms for your custom configurations:
- Open your
.csprojfile and remove all traces ofDebugandReleaseconfigurations, including any property groups, transform file references, or SlowCheetah-specific transform entries. - Clean your project (right-click the project > Clean) to remove any cached build artifacts.
- Restart Visual Studio to ensure all cached configuration data is cleared.
- Now when you click "Add Transform", it should only generate files for the configurations you have active in the Configuration Manager.
内容的提问来源于stack exchange,提问作者JakeJ

