服务器位于 Linux 中,但我们尝试发布 .net core 文件夹。它在 IIS 中工作正常,但在 Linux 服务器中工作不正常。我们按照以下方式将项目部署到谷歌服务器。
https://cloud.google.com/blog/products/gcp/4-ways-you-can-deploy-an-aspnet-core-app-to-gcp
尝试了 4 天。我需要将我的证书读取代码转换为 Linux 服务器模式,如下所示。
string base64str = Convert.ToBase64String(Certificate);
X509Certificate2 certificate = new X509Certificate2(baseBytes, "notasecret", X509KeyStorageFlags.Exportable);
Run Code Online (Sandbox Code Playgroud)
我们在上面的行中使用了生成签名的 url,该文件存储在 google 存储库中。