简体   繁体   English

如何构建 webform 解决方案并将其部署在 Azure devops 中?

[英]how to build webform solution and deployment it in Azure devops?

it is a webform solution created by vs2008,it has no ".csproj" file,the.cs code is in "App_Code" folder。 Azure devops build the solution success,but deploy fail, the deploy result error is "Error: No package found with specified pattern.它是一个由vs2008创建的webform解决方案,它没有“.csproj”文件,.cs代码在“App_Code”文件夹中。 Azure devops构建解决方案成功,但部署失败,部署结果错误为“Error: No package找到具有指定模式的。
Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.";检查任务中提到的 package 是否在构建或前一阶段作为工件发布并在当前作业中下载。";

here is the build log:这是构建日志:

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

here is the Publish Artifact log:这是发布工件日志:

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

The root cause of this这其中的根本原因

##[warning]Directory 'D:\a\1\a' is empty. ##[警告]目录 'D:\a\1\a' 为空。 Nothing will be added to build artifact 'drop'.不会添加任何内容来构建工件“drop”。

Warning is that you are missing multiple dll files.警告是您丢失了多个dll文件。

1. Go to Tools -> Library Package Manager -> Package Manager Console 1. Go 到工具 -> 库 Package 管理器 -> Package 管理器控制台
Install Dapper.dll and Newtonsoft.Json.dll安装Dapper.dllNewtonsoft.Json.dll

2. Make sure you don't copy anything to $(build.artifactstagingdirectory) in your definition. 2.确保您没有将任何内容复制到定义中的$(build.artifactstagingdirectory) Don't miss ' Copy Files'-Task before the 'publish artifact'不要错过“ Copy Files'-Task ”- 'publish artifact'之前的任务

References: 'Newtonsoft' could not be found , https://github.com/microsoft/azure-pipelines-tasks/issues/7247 and VSTS: Directory 'd:\a\1\a' is empty.参考资料: 找不到“Newtonsoft”https://github.com/microsoft/azure-pipelines-tasks/issues/7247VSTS:目录“d:\a\1\a”为空。 Nothing will be added to build artifact 'drop' 不会添加任何内容来构建工件“drop”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM