我试图通过powershell从jenkins发布我的dotnet项目-api。问题是,当我从powershell发布它时,它丢失了大约30个文件,我无法访问api。但是,当我手动从visual studio (或从带有命令的visual studio包管理器控制台)发布它时,它工作得非常完美。是什么引起了这个问题?
下面是我正在运行的发布api的命令;
dotnet restore
dotnet build --configuration release
dotnet publish -c release --output "path to the publish file"我也尝试过用这个发布命令,但是它没有起作用;
dotnet publish dotnet publish -c Release --self-contained -r win10-x64
我一直试图解决这个问题很长时间,但我找不到办法。我非常感谢你的帮助。谢谢!!
发布于 2021-09-30 13:14:04
您应该尝试执行以下2个Windows命令
“C:\ProgramFiles\dotnet\dotnet.exe”还原yourProjectSLN文件
E.g:yourProjectSLN = git/FolderName/ProjectName.sln,它应该与jenkins配置相同
发布yourProject_csproj_file_location -c:Release
git\FolderName\ProjectName.csproj = E.g:yourProject_csproj_file_location
https://stackoverflow.com/questions/69389866
复制相似问题