在 Visual Studio 中使用 .NET/C# 部署 Google 函数,在部署命令后出现错误

问题描述 投票:0回答:1

我完全按照本指南部署 .NET google 云功能:https://cloud.google.com/functions/docs/create-deploy-http-dotnet

我进入执行此命令的阶段:

gcloud functions deploy csharp-http-function --gen2 --entry-point=HelloWorld.Function --runtime=dotnet6 --region=us-central1 --source=. --trigger-http --allow-unauthenticated

我收到此错误:

ERROR: gcloud crashed (PermissionError): [Errno 13] Permission denied: '.\\.vs\\helloworld\\FileContentIndex\\030dc1d0-8d66-48c0-a87a-6905f4a624ae.vsidx'

我看到的针对此问题的大多数解决方案是,当尝试访问目录而不是文件时会发生此错误,但这很明显是命令末尾带有 .vsidx 扩展名的文件

我不知道为什么会发生这种情况,这真的让我很困惑。

我有一个 helloworld 目录,里面有 HelloWorld.csproj 和 Function.cs 文件,没有其他东西。我已在 powershell 窗口中执行 gcloud 授权命令并连接我的帐户并链接到适当的项目。

.net google-cloud-platform google-cloud-functions
1个回答
0
投票

嗯,我觉得很傻。发生这种情况是因为我试图从 Visual Studio Powershell 窗口中运行部署命令,这意味着文件已打开并锁定,使其无法访问。

© www.soinside.com 2019 - 2024. All rights reserved.