【发布时间】:2017-11-21 02:21:15
【问题描述】:
我为使用 Azure AD B2C 的 ASP.NET Core 1.1 项目设置了 CI(来自此示例 - https://github.com/Azure-Samples/active-directory-b2c-dotnetcore-webapp)。所以这就是我在 .csproj 文件中的内容:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>
<PropertyGroup>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
...
</ItemGroup>
<ItemGroup>
<PackageReference Include="BuildWebCompiler" Version="1.11.326" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
<PackageReference Include="Microsoft.Identity.Client" Version="1.1.0-preview" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
</ItemGroup>
</Project>
当我转到 VSTS 时,我看到以下错误日志:
开始:构建
**************************************************** *************************************
任务:.NET Core 描述:使用 dotnet core 命令行构建、测试和发布。 版本:1.0.2 作者:微软公司
帮助: More Information
"C:\Program Files\dotnet\dotnet.exe" build d:\a\1\s\MMLServices\MMLServices.csproj --配置发布 Microsoft (R) Build Engine 版本 15.1.1012.6693 版权所有 (C) 微软公司。保留所有权利。
C:\Users\buildguest.nuget\packages\buildwebcompiler\1.11.326\build\BuildWebCompiler.targets(15,9):错误 MSB4062:无法从程序集 C 加载“WebCompiler.CompilerBuildTask”任务: \Users\buildguest.nuget\packages\buildwebcompiler\1.11.326\build..\tools\WebCompiler.exe。无法加载文件或程序集“Microsoft.Build.Utilities.v4.0,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”。该系统找不到指定的文件。确认声明正确,程序集及其所有依赖项都可用,并且任务包含实现 Microsoft.Build.Framework.ITask 的公共类。 [d:\a\1\s\MMLServices\MMLServices.csproj]
构建失败。
C:\Users\buildguest.nuget\packages\buildwebcompiler\1.11.326\build\BuildWebCompiler.targets(15,9):错误 MSB4062:无法从程序集 C 加载“WebCompiler.CompilerBuildTask”任务: \Users\buildguest.nuget\packages\buildwebcompiler\1.11.326\build..\tools\WebCompiler.exe。无法加载文件或程序集“Microsoft.Build.Utilities.v4.0,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”。该系统找不到指定的文件。确认声明正确,程序集及其所有依赖项都可用,并且任务包含实现 Microsoft.Build.Framework.ITask 的公共类。 [d:\a\1\s\MMLServices\MMLServices.csproj] 0 个警告 1 个错误
经过时间 00:00:03.66 错误:C:\Program Files\dotnet\dotnet.exe 失败,返回码:1 Dotnet 命令在以下项目中因非零退出代码而失败:d:\a\1\s\MMLServices\MMLServices.csproj
那么,我该如何解决这个问题?
更新:
我添加了debug=true,这是之后的日志(发布任务):
2017-06-20T15:23:36.6048010Z [command]"C:\Program Files\dotnet\dotnet.exe" 发布 d:\a\1\s\MMLServices\MMLServices.csproj --配置发布 --输出 d:\a\1\a\MMLServices 2017-06-20T15:23:36.7748032Z Microsoft (R) Build Engine 版本 15.1.1012.6693 2017-06-20T15:23:36.7758030Z 版权所有 (C) Microsoft Corporation。版权所有。 2017-06-20T15:23:36.7758030Z 2017-06-20T15:23:37.3732835Z C:\Users\buildguest.nuget\packages\buildwebcompiler\1.11.326\build\BuildWebCompiler.targets(15,9):错误 MSB4062:无法从程序集 C:\Users\ 加载“WebCompiler.CompilerBuildTask”任务buildguest.nuget\packages\buildwebcompiler\1.11.326\build..\tools\WebCompiler.exe。无法加载文件或程序集“Microsoft.Build.Utilities.v4.0,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”。该系统找不到指定的文件。确认声明正确,程序集及其所有依赖项都可用,并且任务包含实现 Microsoft.Build.Framework.ITask 的公共类。 [d:\a\1\s\MMLServices\MMLServices.csproj] 2017-06-20T15:23:37.3943585Z ##[调试]rc:1 2017-06-20T15:23:37.3943585Z ##[调试]成功:假 2017-06-20T15:23:37.3973597Z ##[错误]错误:C:\Program Files\dotnet\dotnet.exe 失败,返回码:1 2017-06-20T15:23:37.3973597Z ##[debug]Processed: ##vso[task.issue type=error;]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1 2017-06-20T15:23:37.4003593Z ##[debug] 任务结果:失败 2017-06-20T15:23:37.4003593Z ##[错误]Dotnet 命令在以下项目中以非零退出代码失败:d:\a\1\s\MMLServices\MMLServices.csproj 2017-06-20T15:23:37.4003593Z ##[debug]Processed:##vso[task.issue type=error;]Dotnet 命令在以下项目中因非零退出代码而失败:d:\a\1\ s\MMLServices\MMLServices.csproj 2017-06-20T15:23:37.4034692Z ##[debug]Processed:##vso[task.complete result=Failed;]Dotnet 命令在以下项目中失败,退出代码为非零:d:\a\1\ s\MMLServices\MMLServices.csproj 2017-06-20T15:23:37.4073330Z ##[部分]整理:发布
【问题讨论】:
标签: asp.net-core-mvc azure-pipelines asp.net-core-1.1