我知道我需要管理员权限才能安装Docker Desktop;但是我必须是管理员才能运行它吗?该文件没有说,我做的,谷歌搜索并不意味着要么; 但是如果我尝试以非特权用户身份运行它,该进程会立即被终止,并且我会收到一个事件日志条目,上面写着“进程需要提升权限才能运行”。
我在公司环境中运行 Windows 10 Enterprise,我们有非特权帐户。在这种情况下 Docker Desktop 是否不可用,或者我只是以某种方式错误地安装了它?
我在IIS 7.5下运行的ASP.NET Web应用程序和我的应用程序日志已满这样的错误:
活动代码:3012
事件消息:处理Web或脚本资源请求时发生错误.资源标识符无法解密.
...
例外信息:
Run Code Online (Sandbox Code Playgroud)Exception type: HttpException Exception message: Unable to validate data.
在System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(布尔fEncrypt,字节[] buf中,字节[]改性剂,的Int32开始,的Int32长度,布尔useValidationSymAlgo,布尔useLegacyMode,型IV型型IV型,布尔signData)
...
索取信息:
Run Code Online (Sandbox Code Playgroud)Request URL: http://www.mysite.com/WebResource.axd?d=l0ngstr1ng0fl3tt3rs4ndd1g1ts Request path: /WebResource.axd
...
如何防止它们出现?根据此链接,我已将以下代码添加到我的Global.asax文件中:
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an *unhandled* error occurs
//// get reference to the source of the exception chain
Exception ex = Server.GetLastError();
string message = ex.Message;
string path = Request.Path;
// ignore the following:
// errors due to bots trying AXD URLs
// …
Run Code Online (Sandbox Code Playgroud) 我有一个“顶级”网站www.ccesd.ac.uk和各种“低级”网站,例如www.ccesd.ac.uk/BritSocAt,它们是独立的网站但共享很多代码。这些较低级别的站点在 IIS 7.5 中被指定为 Web 应用程序,并从www.ccesd.ac.uk继承了一个通用的 web.config 文件,尽管它们位于自己的应用程序池中。
我已经使用 URL Rewrite 模块配置了 IIS 7.5,以便较低级别的站点可以拥有自己不同的 URL,例如 www.BritSocAt.com,它映射到 www.ccesd.ac.uk/BritSocAt。
每个站点都有自己的 Global.asax 文件,其中包含为漂亮 URL 定义的 URL 路由规则。这些 URL(/Home、/About、/Contact 等)对所有站点都是通用的,包括顶级 (ccesd.ac.uk) 站点。
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RegisterRoutes(System.Web.Routing.RouteTable.Routes);
}
// ** URL ROUTING **
private static void RegisterRoutes(System.Web.Routing.RouteCollection routes)
{
routes.Ignore("{resource}.axd/{*pathInfo}");
// HOME
routes.MapPageRoute("Home", "Home", "~/Body.aspx", false, new System.Web.Routing.RouteValueDictionary
{ { "control", "HomePage" } });
// CONTACT US
routes.MapPageRoute("ContactUs", "Contact", …
Run Code Online (Sandbox Code Playgroud) ControllerBase
Conflict()
包含诸如返回ConflictResult
派生自 的对象(表示 HTTP 409 响应)之类的方法StatusCodeResult
。生成的响应正文具有内容类型application/problem+json
,如下所示:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.8",
"title": "Conflict",
"status": 409,
"traceId": "0HLO99QHFC9QI:00000001"
}
Run Code Online (Sandbox Code Playgroud)
没有用于 HTTP 410 响应的内置方法/类,因此我创建了一个:
[DefaultStatusCode(410)]
public class GoneResult : StatusCodeResult
{
public GoneResult() : base(410)
{}
}
...
public static class ControllerBaseExtensions
{
public static GoneResult Gone(this ControllerBase controllerBase) // this doesn't give all the problem+JSON attributes
{
return new GoneResult();
}
}
Run Code Online (Sandbox Code Playgroud)
然而,这给出了
{
"type": "about:blank",
"status": 410
}
Run Code Online (Sandbox Code Playgroud)
即,type
值不同并且缺少title
和字段。traceId
我还想为 …
asp.net ×1
asp.net-core ×1
c# ×1
docker ×1
global-asax ×1
iis ×1
logging ×1
url-routing ×1
windows-10 ×1