gpt4 book ai didi

c# - 如何使用 Docker 容器设置 ASP.NET Web 应用程序

转载 作者:太空宇宙 更新时间:2023-11-03 15:23:25 27 4
gpt4 key购买 nike

我已按照此处的安装说明进行操作:https://azure.microsoft.com/en-us/documentation/articles/vs-azure-tools-docker-edit-and-refresh/并制作了一个空的 ASP.Net hello world 项目。当我尝试构建我的项目时,我不断收到此错误:

Error   MSB3073 The command "powershell -ExecutionPolicy RemoteSigned .\Docker\DockerTask.ps1 -Build -Environment Debug -Machine 'default'" exited with code 1. HelloWorld  C:\dev\HelloWorld\src\HelloWorld\Properties\Docker.targets  37  

进一步挖掘后,我得到了这个错误:

1>------ Build started: Project: HelloWorld, Configuration: Debug Any CPU ------
1>
1> Build succeeded.
1> 0 Warning(s).
1> 0 Error(s).
1>
1> Time elapsed 00:00:00.0958314
1>
1> .\Docker\DockerTask.ps1 : The term '.\Docker\DockerTask.ps1' is not recognized as the name of a cmdlet, function,
1> script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
1> correct and try again.
1> At line:1 char:1
1> + .\Docker\DockerTask.ps1 -Build -Environment Debug -Machine 'default'
1> + ~~~~~~~~~~~~~~~~~~~~~~~
1> + CategoryInfo : ObjectNotFound: (.\Docker\DockerTask.ps1:String) [], CommandNotFoundException
1> + FullyQualifiedErrorId : CommandNotFoundException
1>
1>C:\dev\HelloWorld\src\HelloWorld\Properties\Docker.targets(37,5): error MSB3073: The command "powershell -ExecutionPolicy RemoteSigned .\Docker\DockerTask.ps1 -Build -Environment Debug -Machine 'default'" exited with code 1.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

我在 Windows 10 64 位上使用 Visual Studios 2015。

最佳答案

问题是我的工作目录设置与默认设置不同。通过使用 get-location 命令,我能够找出工作目录的位置,并为其提供该目录的相对路径。

HelloWorld\src\HelloWorld\Docker\DockerTask.ps1

关于c# - 如何使用 Docker 容器设置 ASP.NET Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36341546/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com