我在每个应用程序启动时都有这个。
有人知道这是从哪里来的吗?
信息: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager用户配置文件是可用的。使用‘/Users/thomas/..aspnet/DataProtection’作为密钥存储库;密钥在rest时不会被加密。
// run the web host
var PathToContentRoot = Directory.GetCurrentDirectory();
var Host = WebHost.CreateDefaultBuilder()
.UseKestrel()
.UseContentRoot(PathToContentRoot)
.UseStartup<WebStartup>()
.UseNLog()
.Build();我没有任何关于‘数据保护’,‘密钥’等,我也不想要任何形式的安全功能。
ConfigureServices部分中的代码是:
// find all controllers
var Controllers =
from a in AppDomain.CurrentDomain.GetAssemblies().AsParallel()
from t in a.GetTypes()
let attributes = t.GetCustomAttributes(typeof(ControllerAttribute), true)
where attributes?.Length > 0
select new { Type = t };
var ControllersList = Controllers.ToList();
Logging.Info($"Found {ControllersList.Count} controllers");
// register them
foreach (var Controller in ControllersList)
{
Logging.Info($"[Controller] Registering {Controller.Type.Name}");
Services
.AddMvc()
.AddJsonOptions(Options => Options.SerializerSettings.ContractResolver = new DefaultContractResolver())
.AddApplicationPart(Controller.Type.Assembly);
}
// add signalR
Services.AddSignalR();这样做是为了允许使用来自外部程序集的控制器。
发布于 2021-02-12 04:41:42
https://stackoverflow.com/questions/52424618
复制相似问题