gpt4 book ai didi

c# - 如何构建 Webform 解决方案并将其部署在 Azure DevOps 中?

转载 作者:行者123 更新时间:2023-12-03 03:41:28 29 4
gpt4 key购买 nike

这是一个由vs2008创建的webform解决方案,它没有“.csproj”文件,.cs代码位于“App_Code”文件夹中。Azure DevOps构建解决方案成功,但部署失败,部署结果错误为“错误:找不到具有指定模式的包。
检查任务中提到的包是否在构建或上一阶段中作为工件发布并在当前作业中下载。”;

这是构建日志:

D:\a\1\s\DataManagerWeb\App_Code\Repository\BaseRepository.cs(11): warning CS0169: The field 'BaseRepository.connStr' is never used [D:\a\1\s\DataManagerWeb.metaproj]
##[warning]DataManagerWeb\ajax\accountAction.aspx.cs(187,0): Warning CS0162: Unreachable code detected
D:\a\1\s\DataManagerWeb\ajax\accountAction.aspx.cs(187): warning CS0162: Unreachable code detected [D:\a\1\s\DataManagerWeb.metaproj]
Done Building Project "D:\a\1\s\DataManagerWeb.metaproj" (default targets).
Done Building Project "D:\a\1\s\DataManagerWeb.sln" (default targets).

Build succeeded.

"D:\a\1\s\DataManagerWeb.sln" (default target) (1) ->
(ValidateProjects target) ->
D:\a\1\s\DataManagerWeb.sln.metaproj : warning MSB4121: The project configuration for project "DataManagerWeb" was not specified in the solution file for the solution configuration "Release|Any CPU". [D:\a\1\s\DataManagerWeb.sln]


"D:\a\1\s\DataManagerWeb.sln" (default target) (1) ->
"D:\a\1\s\DataManagerWeb.metaproj" (default target) (2) ->
(Build target) ->
D:\a\1\s\DataManagerWeb.metaproj : warning MSB3030: Could not copy the file "D:\a\Dapper.dll" because it was not found.
D:\a\1\s\DataManagerWeb.metaproj : warning MSB4181: The "Copy" task returned false but did not log an error.


"D:\a\1\s\DataManagerWeb.sln" (default target) (1) ->
"D:\a\1\s\DataManagerWeb.metaproj" (default target) (2) ->
D:\a\1\s\DataManagerWeb.metaproj : warning MSB3030: Could not copy the file "D:\a\1\s\Newtonsoft.Json.dll" because it was not found.
D:\a\1\s\DataManagerWeb.metaproj : warning MSB4181: The "Copy" task returned false but did not log an error.


"D:\a\1\s\DataManagerWeb.sln" (default target) (1) ->
"D:\a\1\s\DataManagerWeb.metaproj" (default target) (2) ->
D:\a\1\s\DataManagerWeb\App_Code\BLL\Sessions.cs(27): warning CS0168: The variable 'ex' is declared but never used [D:\a\1\s\DataManagerWeb.metaproj]
D:\a\1\s\DataManagerWeb\App_Code\Repository\BaseRepository.cs(11): warning CS0169: The field 'BaseRepository.connStr' is never used [D:\a\1\s\DataManagerWeb.metaproj]
D:\a\1\s\DataManagerWeb\ajax\accountAction.aspx.cs(187): warning CS0162: Unreachable code detected [D:\a\1\s\DataManagerWeb.metaproj]

8 Warning(s)
0 Error(s)

Time Elapsed 00:00:38.44
Finishing: Build solution

这里是发布工件日志:

Starting: Publish Artifact
==============================================================================
Task : Publish build artifacts
Description : Publish build artifacts to Azure Pipelines or a Windows file share
Version : 1.198.0
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/publish-build-artifacts
==============================================================================
##[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.
Finishing: Publish Artifact

最佳答案

造成这种情况的根本原因

##[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.

警告您缺少多个 dll 文件。

1. 转到“工具”->“库包管理器”->“包管理器控制台”
安装Dapper.dllNewtonsoft.Json.dll

2. 确保您没有将任何内容复制到定义中的 $(build.artifactstagingdirectory) 中。不要错过“发布工件”

之前的“ 复制文件”-任务

引用文献:'Newtonsoft' could not be found , https://github.com/microsoft/azure-pipelines-tasks/issues/7247VSTS: Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'drop'

关于c# - 如何构建 Webform 解决方案并将其部署在 Azure DevOps 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71044270/

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