有一段代码:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
#if DEBUG == false
.WriteTo.File(rollingInterval: RollingInterval.Day,
rollOnFileSizeLimit: true,
shared: true,
outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}",
path: string.Concat(AppDomain.CurrentDomain.BaseDirectory, @"Logs\Log.log"),
encoding: Encoding.UTF8)
#endif
.WriteTo.Console(outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
这需要连接才能工作using System.Text。在工作时,在发布项目之前,我使用“分析和清理代码”->“开始清理代码”,由于选择了一个,删除Debug了using System.Text. 因此,每次都得重新写一遍,因为。尝试发布解决方案时出现编译错误(因为解决方案的发布是在 中完成的Release)。
问题:如何在清理这个特定'a 的代码时禁用删除using?