DNX生成失败-从msbuild.exe接收到意外的退出代码:1 [英] DNX Build Failed - Unexpected exit code received from msbuild.exe: 1

查看:92
本文介绍了DNX生成失败-从msbuild.exe接收到意外的退出代码:1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么以下构建失败.

I cannot see why the below build is failing.

项目成功构建.

在以下输出中会导致"## [错误]从msbuild.exe接收到意外退出代码:1"的结果?

What could "##[error]Unexpected exit code received from msbuild.exe: 1" result from in the below output?

 Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSBuild\1.0.13\VSBuild.ps1
 C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe "C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj" /nologo /m /nr:false /fl /flp:"logfile=C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj.log" /dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /t:Build,FileSystemPublish /p:PublishConfiguration=release /p:PublishOutputPathNoTrailingSlash=C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0"
 Build started 8/3/2015 9:27:34 AM.
      1>Project "C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj" on node 1 (Build;FileSystemPublish target(s)).
      1>PrepareForBuild:
          Creating directory "..\artifacts\bin\MyProject.Api\".
          Creating directory "..\artifacts\obj\MyProject.Api\any cpu\release\".
        PreComputeCompileTypeScript:
          C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\tsc.exe  --noEmitOnError COMPUTE_PATHS_ONLY
        CompileTypeScript:
        Skipping target "CompileTypeScript" because it has no outputs.
        CoreCompile:
          C:\Users\buildguest\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6\bin\dnx.exe --appbase "C:\a\8ac4a4f6\Root\src\MyProject.Api" "C:\Users\buildguest\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6\bin\lib\Microsoft.Framework.PackageManager\Microsoft.Framework.PackageManager.dll" pack "C:\a\8ac4a4f6\Root\src\MyProject.Api" --configuration release --out "..\artifacts\bin\MyProject.Api"
          Microsoft .NET Development Utility CLR-x86-1.0.0-beta6-12256
          Building MyProject.Api for DNX,Version=v4.5.1
            Using Project dependency MyProject.Api 1.0.0
              Source: C:\a\8ac4a4f6\Root\src\MyProject.Api\project.json
            Using Project dependency MyProject.Domain.Model 1.0.0
              Source: C:\a\8ac4a4f6\Root\src\MyProject.Domain.Model\project.json
            ... (deleted for readability)
            Using Assembly dependency framework/fx/mscorlib 4.0.0.0
              Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll
            Using Assembly dependency framework/fx/System 4.0.0.0
              Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.dll
            ... (deleted for readability)
          The following commands will not be exported for global install: web.
          MyProject.Api -> C:\a\8ac4a4f6\Root\src\artifacts\bin\MyProject.Api\release\MyProject.Api.1.0.0.nupkg
          MyProject.Api -> C:\a\8ac4a4f6\Root\src\artifacts\bin\MyProject.Api\release\MyProject.Api.1.0.0.symbols.nupkg
          Build succeeded.
              0 Warning(s)
              0 Error(s)
          Time elapsed 00:00:09.0953302
          Total build time elapsed: 00:00:09.1660739
          Total projects built: 1
        GetTypeScriptCopyToOutputDirectoryItems:
          Adding items with BuildAction=TypeScriptCompile to the same collections that will be populated (with items of other BuildActions) by the GetCopyToOutputDirectoryItems target
        GatherAllFilesToPublish:
          Environment variables:
          Path=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\extensions\microsoft\web tools\external;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\VssAdministrator\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\NPM\Modules;C:\Program Files\nodejs\;C:\NPM\Modules;C:\cordova;C:\java\ant\apache-ant-1.9.4\bin;;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\extensions\microsoft\web tools\external\.git
          C:\Users\buildguest\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta6\bin\dnu.cmd publish "C:\a\8ac4a4f6\Root\src\MyProject.Api" --out "C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish" --configuration release --runtime dnx-clr-win-x86.1.0.0-beta6 --quiet
          Microsoft .NET Development Utility CLR-x86-1.0.0-beta6-12256
          Copying to output path C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish
          Time elapsed 00:00:07.6405449
      1>Done Building Project "C:\a\8ac4a4f6\Root\src\MyProject.Api\MyProject.Api.xproj" (Build;FileSystemPublish target(s)) -- FAILED.
 Build FAILED.
     0 Warning(s)
     0 Error(s)
 Time Elapsed 00:00:19.07
 ##[error]Unexpected exit code received from msbuild.exe: 1

global.json:

{
  "sources": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-beta6",
    "runtime": "clr",
    "architecture": "x86"
  }
}

project.json :

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
    "Microsoft.AspNet.Mvc": "6.0.0-beta6"
  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
  },

  "frameworks": {
    "dnx451": { }
  },

  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ],
  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ]
}

从msbuild.exe中删除以下参数将导致构建成功:

Removing the following arguments from msbuild.exe leads to a successful build:

/t:Build,FileSystemPublish /p:PublishConfiguration=release /p:PublishOutputPathNoTrailingSlash=C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish

我的发布参数显然有问题.

There is clearly something wrong with my publish arguments.

推荐答案

我发现了问题.

以下引发异常:

dnu.cmd publish "C:\a\8ac4a4f6\Root\src\MyProject.Api" --out "C:\a\8ac4a4f6\Root\MyProject\artifacts\bin\release\Publish" --configuration release --runtime dnx-clr-win-x86.1.0.0-beta6 --quiet

我在没有--quiet参数的情况下运行了它,然后出现了ArgumentNullException:

I ran it without the --quiet argument and out comes an ArgumentNullException:

Restoring packages for C:\a\8ac4a4f6\Root\src\RelatedProject\project.json
----------
System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Microsoft.Framework.Runtime.Project.GetTargetFramework(FrameworkName targetFramework)
   at Microsoft.Framework.Runtime.ProjectReferenceDependencyProvider.GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
   at Microsoft.Framework.PackageManager.LocalWalkProvider.FindLibrary(LibraryRange libraryRange, FrameworkName targetFramework, Boolean includeUnlisted)
   at Microsoft.Framework.PackageManager.RestoreOperations.<FindProjectMatch>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryMatch>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryEntry>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<CreateGraphNode>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<CreateGraphNode>d__71.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<>c__DisplayClass69_0.<<Execute>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<Execute>d__69.MoveNext()
----------
Restore failed
Value cannot be null.
Parameter name: key

我删除了项目依赖项,现在它可以工作了.我不知道例外是什么.在此处上发布了一个问题

I removed the project dependency and it now works. I have no idea what the exception entails. Posted a question regarding that here.

这篇关于DNX生成失败-从msbuild.exe接收到意外的退出代码:1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆