为什么 Visual Studio for Mac 不能打开从 SPA 模板创建的项目?

Why won't Visual Studio for Mac open a project created from SPA templates?

完全披露:这是我第一次尝试在 Mac

上进行任何 .NET 开发

Visual Studio for Mac 将不会打开在 CLI 中使用 dotnet new 创建的 Angular 项目。尝试在 Visual Studio 中为 Mac 打开 csproj 文件会导致错误消息:

Could not save solution: /Users/aaron/Projects/ngApp/ngApp.sln" followed by "Load operation failed

从命令行使用 "angular" SPA 模板创建了一个新的 .NET Core / Angular 应用程序,方法是创建一个名为 "ngApp" 的新目录,切换到该目录,然后然后输入 "dotnet new angular"。这生成了一个项目,其中包含我期望的所有内容(包括 csproj 文件)。根据我在 Windows 上使用 "dotnet new" 创建的项目的 csproj 文件的经验,csproj 文件似乎是正确的。

尝试在 Visual Studio 中为 Mac 打开 csproj 文件导致错误消息:"Could not save solution: /Users/aaron/Projects/ngApp/ngApp.sln" 后跟 "Load operation failed"。

我是不是漏掉了什么重要的东西?是否有任何日志可以帮助我解决这个问题?

根据@MattWard 的建议,我查看了日志,其中显示我遇到了一些权限问题。使用 chmod 解决该问题只会发现更多有关权限和环境变量的问题。完全重新安装 Node、.NET Core 和 Visual Studio 解决了这个问题。

我能够从 CLI 运行 dotnet new angularnpm install 整理 Node 包,然后在 Visual Studio 中打开项目没有问题。

** 小心sudo所有的东西。我会弄乱你的整个世界。 **