AspNetCore 应用程序的 Azure 部署在 Mac 上失败

Azure deployment of AspNetCore app fails on Mac

我将 Visual Studio 用于 Mac,但在尝试使用 .Net Core 2.0 发布 AspNetCore 应用程序时出现错误。我查看了失败的堆栈跟踪,它显示访问 com.xamarin.universalinstaller.

时出错
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018: The "VSMSDeploy" task failed unexpectedly.
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018: System.Security.SecurityException: No access to the given key ---> System.UnauthorizedAccessException: Access to the path "/Library/Application Support/com.xamarin.universalinstaller" is denied.
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x0005f] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/Directory.cs:121 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at System.IO.Directory.CreateDirectory (System.String path) [0x0008f] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/Directory.cs:85 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at System.IO.DirectoryInfo.Create () [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/DirectoryInfo.cs:144 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:Create ()
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00030] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/Directory.cs:103 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at System.IO.Directory.CreateDirectory (System.String path) [0x0008f] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/Directory.cs:85 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, System.Boolean is_volatile) [0x00038] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:152 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:    --- End of inner exception stack trace ---
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, System.Boolean is_volatile) [0x00042] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:154 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:132 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Win32.KeyHandler.Lookup (Microsoft.Win32.RegistryKey rkey, System.Boolean createNonExisting) [0x000bf] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:428 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Win32.UnixRegistryApi.OpenSubKey (Microsoft.Win32.RegistryKey rkey, System.String keyname, System.Boolean writable) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:867 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name, System.Boolean writable) [0x0001b] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:466 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:450 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at (wrapper remoting-invoke-with-check) Microsoft.Win32.RegistryKey:OpenSubKey (string)
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.NET.Sdk.Publish.Tasks.MsDeploy.Utility.CheckMSDeploymentVersion () [0x0005e] in <a8bbf6f62d6e4b888cb2558952dc0635>:0 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.NET.Sdk.Publish.Tasks.MsDeploy.Utility.get_IsMSDeployInstalled () [0x00013] in <a8bbf6f62d6e4b888cb2558952dc0635>:0 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.NET.Sdk.Publish.Tasks.MsDeploy.Utility.CheckMSDeploymentVersion (Microsoft.Build.Utilities.TaskLoggingHelper log, System.String& errorMessage) [0x00003] in <a8bbf6f62d6e4b888cb2558952dc0635>:0 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.NET.Sdk.Publish.Tasks.MsDeploy.VSMSDeploy.Execute () [0x00034] in <a8bbf6f62d6e4b888cb2558952dc0635>:0 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/msbuild-15.4/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631 
/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(138,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x0022d] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/msbuild-15.4/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:05.75

我查看了我的文件系统,/Library/Application Support/com。xamarin.universalinstaller 不存在。

我没有找到关于此安装程序的任何关于 VSMSDeploy 的信息。

我的问题是,需要单独安装吗?如果是这样,我从哪里得到它?我安装的 VS 是否已损坏(我已尝试重新安装但没有出现错误)?为什么 VSMSDeploy 需要这个?

我真的觉得这有点愚蠢,但我只是尝试创建丢失的文件夹。

/Library/Application Support/com.xamarin.universalinstaller

在我尝试发布后,它抱怨找不到名为 LocalMachine 的 com.xamarin.universalinstaller 子文件夹,所以我创建了它。

/Library/Application Support/com.xamarin.universalinstaller/LocalMachine

现在 VS Mac 像梦一样发布。