我正在尝试对我的服务结构web api项目进行一些登录,并且它始终被禁用。在使用任何其他SF项目类型之前,我从未见过这种行为。
[NonEvent]
public void ServiceMessage(ServiceContext serviceContext, string message, params object[] args)
{
if (IsEnabled())
{
string finalMessage = string.Format(message, args);
ServiceMessage(
serviceContext.ServiceName.ToString(),
serviceContext.ServiceTypeName,
GetReplicaOrInstanceId(serviceContext),
serviceContext.PartitionId,
serviceContext.CodePackageActivationContext.ApplicationName,
serviceContext.CodePackageActivationContext.ApplicationTypeName,
serviceContext.NodeContext.NodeName,
finalMessage);
}
}
IsEnabled始终返回false。您是否需要为Web api项目执行特殊设置?这也是.net核心。不确定这是否会影响它。