小编blo*_*dix的帖子

如何在Windows启动时运行C#应用程序?

我创建了一个在启动期间启动的应用程序,下面的代码如下.
重启后,该进程在进程管理器工具上运行,但我无法在屏幕上看到该应用程序.当我从启动注册表值打开相同的.exe文件时,程序运行完美.

// The path to the key where Windows looks for startup applications
RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

// Add the value in the registry so that the application runs at startup
rkApp.SetValue("MyApp", Application.ExecutablePath.ToString());
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能解决这个问题?

c# registry startup

60
推荐指数
6
解决办法
11万
查看次数

将C#.dll引用从绝对更改为相对

我编译了我的项目,我的一些项目添加了.dll有绝对引用.当我尝试在另一台机器上运行我的项目时,它会从原始项目路径中查找.dll.

如何使用相对路径使项目查找.dll?

c# dll reference relative-path absolute-path

14
推荐指数
1
解决办法
2万
查看次数

Kubernetes HPA 部署找不到目标资源

我正在尝试部署我自己的 HPA,但没有成功。虽然在尝试部署 kubernetes 的官方 PHP 时,它按计划工作。当我尝试使用 HPA 部署我自己的测试部署时,它不起作用。

比较 2 个 HPA 部署流程——Kubernetes 官方部署 VS My Test 部署:

部署官方 Kubernetes 模板镜像:

$ kubectl run php-apache --image=gcr.io/google_containers/hpa-example --requests=cpu=200m --expose --port=80
service "php-apache" created
deployment "php-apache" created
Run Code Online (Sandbox Code Playgroud)

我自己的测试部署结果

{
   "apiVersion": "autoscaling/v1",
   "kind": "HorizontalPodAutoscaler",
   "metadata": {
       "annotations": {
           "autoscaling.alpha.kubernetes.io/conditions": "[{\"type\":\"AbleToScale\",\"status\":\"False\",\"lastTransitionTime\":\"2019-12-22T20:39:59Z\",\"reason\":\"FailedGetScale\",\"message\":\"the HPA controller was unable to get the target's current scale: deployments/scale.apps \\\"gw-autoscale-t6\\\" not found\"}]"
       },
       "creationTimestamp": "2019-12-22T20:39:44Z",
       "labels": {
           "app": "gw-autoscale-t6"
       },
       "name": "gw-autoscale-t6",
       "namespace": "dev",
       "resourceVersion": "17299134",
       "selfLink": "/apis/autoscaling/v1/namespaces/dev/horizontalpodautoscalers/gw-autoscale-t6",
       "uid": "2f7e014c-24fb-11ea-a4d8-a28620329da6"
   }, …
Run Code Online (Sandbox Code Playgroud)

node.js kubernetes kubectl kubernetes-helm

6
推荐指数
1
解决办法
2456
查看次数