小编Woj*_*Rak的帖子

C#:迁移到 NET 5 后在 dotnet 构建期间内存不足

我们使用它App Buddy作为我们的 CI/CD 系统。今天我们将项目从 迁移ASP.NET Core 3.1NET 5. 在 dotnet 构建开始消耗大量 RAM(分配大约 10-12GB)之后,我们的服务器上没有那么多内存。

dotnet build在我们的 CI/CD 服务器上Microsoft.CSharp.Core.targets(71,5): error : Process terminated. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

我尝试过使用-maxCpuCount:1但不起作用。是否有可能限制dotnet build可以使用的内存?

.net c# continuous-integration out-of-memory .net-5

7
推荐指数
1
解决办法
2960
查看次数

销毁对象中的Unity C# StartCoroutine()

我在带有 C# 的 Unity 中有这个脚本,协程的时间不工作,第二行forwardForce = 10f没有被调用:

using UnityEngine;
using System.Collections;

public class SlowPickup : MonoBehaviour
{
  public float waitTime = 2f;

  private IEnumerator DecreaseSpeed ()
  {
     GameObject.Find("Player").GetComponent<PlayerMovement>().forwardForce = 1f;
     yield return new WaitForSeconds(waitTime);
     GameObject.Find("Player").GetComponent<PlayerMovement>().forwardForce = 10f;
  }

  void OnTriggerEnter ()
  {
    Destroy(gameObject);
    StartCoroutine(DecreaseSpeed());
  }

}
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine

3
推荐指数
1
解决办法
1713
查看次数