gpt4 book ai didi

visual-studio-2017 - VSTS 构建失败;错误 MSB4184 : The expression "[System.IO.Path]::GetDirectoryName(' ')"cannot be evaluated. 路径不合法

转载 作者:行者123 更新时间:2023-12-03 23:56:54 24 4
gpt4 key购买 nike

我正在尝试构建我的 .Net Core 解决方案,但收到了我无法弄清楚的错误消息;

2017-05-22T14:30:56.2490242Z _TransformWebConfig:
2017-05-22T14:30:56.2490242Z No web.config found. Creating 'd:\a\1\s\SIR\obj\Release\net452\win7-x86\PubTmp\Out\web.config'
2017-05-22T14:30:56.2830092Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): Error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.
2017-05-22T14:30:56.2830092Z ##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets;linenumber=124;columnnumber=7;code=MSB4184;]The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.
2017-05-22T14:30:56.2830092Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form. [d:\a\1\s\SIR\Properties.API.csproj]
2017-05-22T14:30:56.2830092Z ##[debug]Processed: ##vso[task.logdetail id=43c372fe-1339-4917-bfb2-2d3438740b01;parentid=e8365874-6f54-4a8c-a31f-62c69bcfdb57;type=Build;result=Failed;finishtime=2017-05-22T14:30:56.2790105Z;progress=100;state=Completed;parentid=e8365874-6f54-4a8c-a31f-62c69bcfdb57;name=;]
2017-05-22T14:30:56.2830092Z Done Building Project "d:\a\1\s\SIR\Properties.API.csproj" (default targets) -- FAILED.

最佳答案

请参阅以下步骤:

  • 添加 NuGet 安装程序 (4.0.0) 任务以还原包
  • 添加 Visual Studio 构建任务(解决方案:**\*.sln;MSBuild 参数:/t:[projects] /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\App1")。 注:projects是该方案中的通用.net框架项目,如/t:project1;project2
  • 添加 .NET Core 任务(命令:publish;取消选中 发布 Web 项目选项 ;项目:$(build.sourcesdirectory)/*Core*.csproj(0x1045 到 679191914 个项目)0x1045 到 679104040679191919 项目名称:04040679191940404000
  • 添加发布构建工件任务
  • 关于visual-studio-2017 - VSTS 构建失败;错误 MSB4184 : The expression "[System.IO.Path]::GetDirectoryName(' ')"cannot be evaluated. 路径不合法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44116769/

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