在哪里可以查看Windows Server 2016中所有会话的完整历史记录?
以下PowerShell命令仅包含当前会话中的命令:
Get-History
Run Code Online (Sandbox Code Playgroud) 我引用了一个需要Microsoft.AspNet.WebApi.Client 5.2.4的.Net Standard 2.0库.这有很多依赖关系,需要重定向才能使用更新的版本.
为了避免包/依赖性爆炸,我更新了csproj文件中的第一个PropertyGroup:
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Run Code Online (Sandbox Code Playgroud)
我期待AutoGenerateBindingRedirects阻止我需要更改Web.config以匹配添加的版本.
为什么我仍然需要将绑定重定向添加到我的Web.config来解决程序集冲突?
在 AspNetCore 中,给定 FilterContext,我希望获得一个路由模板,例如
{controller}/{action}/{id?}
在 Microsoft.AspNet.WebApi 中,我可以从以下位置获取路由模板:
HttpControllerContext.RouteData.Route.RouteTemplate
在 System.Web.Mvc 中我可以从以下位置得到这个:
ControllerContext.RouteData.Route as RouteBase
在AspNetCore中有:
FilterContext.ActionDescriptor.AttributeRouteInfo.Template
然而,并非所有路由都是属性路由。
根据检查属性是否不可用,可以从以下位置组装默认路由和/或映射路由:
FilterContext.RouteData.Routers.OfType<Microsoft.AspNetCore.Routing.RouteBase>().First()
但我正在寻找记录的或简单的更好的方法。