【发布时间】:2020-11-08 02:29:15
【问题描述】:
环境
MacOS 10.14.6 Mojave, Visual Studio For Mac v8.7.9
API service built on .NET Core framework
问题:我有一个 .NET Core 项目,它有一个 Web 部署发布配置文件,用于将更新部署到在 EC2 (IIS) 上运行的 Windows 服务器。
当我在 Windows 上工作时,我可以通过 Visual Studio 中的 Web 部署 UI 轻松部署它,但是在我迁移到 macOS 后,在 Visual Studio 中找不到这样的选项。我可以单击现有的网络部署发布选项,但它总是失败,因为我需要在某处提供密码。我尝试在pubxml 文件下添加<Password>,但它读作无效标签。
错误
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web deployment task failed. (Connected to the remote computer using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Error details:
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Connected to the remote computer ("ec2-3-92-105-216.compute-1.amazonaws.com") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
/usr/local/share/dotnet/sdk/3.1.403/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : The remote server returned an error: (401) Unauthorized.
Publish failed to deploy.
【问题讨论】:
-
你找到关于那个话题的答案了吗?..
-
@Fellow7000 不幸的是没有......
-
有一种方法可以在 dotnet 的命令行中提供密码,但在 Mac 上并没有真正的帮助,因为 dotnet 尝试调用另一个“.exe”文件:-/ dotnet publish projectName.csproj /p:PublishProfile=*profileName* /p:Password=*yourPsw*
-
我明白了,谢谢你的帮助。我切换回 Windows:/
-
看来我也必须这样做。可能有一种方法可以发布到文件夹中,然后手动进行 webdeploy v. FTP 例如...但是,是的,Visual Studio for Mac 远远落后于 Win...可惜。
标签: macos visual-studio asp.net-core webdeploy