xbuild: 在项目中找不到目标。 c# class 库
xbuild: No target found in the project. c# class lib
我正在尝试在 Ubuntu 14.4 LTS 上使用 xbuild 编译一个项目。我有单声道 4.2.3 和 xbuild 12
整个解决方案之前是在 OSX 上使用 mono 构建的,但我的大学进行了一些更改(例如重命名项目),现在它也无法在 OSX 上构建.我一辈子都弄不明白是什么改变导致了这一切。它在 visual studio 和 Jenkins 上的 msbuild 中继续构建良好。
解决方案中有 5 个项目,最初它们都返回错误
<Projfile>:error : No target found in the project
经过一些谷歌搜索后,我将以下内容添加到我所有的项目文件中。
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)" />
现在,只有 2 个 class 库项目返回此错误。
我已经通过 运行 诊断日志记录检查了我所有的 msbuild 变量是否设置为正确的路径,而且我还发现了一些 SO 帖子,它们会检查是否正确安装了 mono。
我有点不知所措。
编辑
这是请求的输出 运行 /v:diag。
mjones@mlclustervs110:~/workspace/Mono-ServiceTemplate-Linux$ ./debugbuild.sh
Scanning for projects...
Found 5 projects with a packages.config file. (Microlise.MonoTemplate.Logger, Microlise.MonoTemplate.Microservice, Microlise.MonoTemplate.Tests.Helpers, Microlise.MonoTemplate.Tests.Intergration, Microlise.MonoTemplate.Tests.Unit)
Looking for installed packages in 'packages'.
Updating 'Microlise.MonoTemplate.Logger'...
Updating 'Microlise.MonoTemplate.Microservice'...
Updating 'Microlise.MonoTemplate.Tests.Helpers'...
Updating 'Microlise.MonoTemplate.Tests.Intergration'...
Updating 'Microlise.MonoTemplate.Tests.Unit'...
XBuild Engine Version 12.0
Mono, Version 4.2.3.0
Copyright (C) 2005-2013 Various Mono authors
Loading default tasks for ToolsVersion: 4.0 from /usr/lib/mono/4.5/Microsoft.Common.tasks
Build started 01/04/2016 08:30:35.
__________________________________________________
Loading default tasks for ToolsVersion: 12.0 from /usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.tasks
Project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" (default target(s)):
Initial Properties:
_ = /usr/bin/xbuild
AspNetConfiguration = $(Configuration)
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
EnableNuGetPackageRestore = true
ftp_proxy = http://foxy:8080
HOME = /home/mjones
http_proxy = http://foxy:8080
https_proxy = https://foxy:8080
LANG = en_GB.UTF-8
LANGUAGE = en_GB:en
LESSCLOSE = /usr/bin/lesspipe %s %s
LESSOPEN = | /usr/bin/lesspipe %s
LOGNAME = mjones
LS_COLORS = rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL = /var/mail/mjones
MSBuildBinPath = /usr/lib/mono/xbuild/12.0/bin
MSBuildExtensionsPath = /usr/lib/mono/xbuild
MSBuildExtensionsPath32 = /usr/lib/mono/xbuild
MSBuildExtensionsPath64 = /usr/lib/mono/xbuild
MSBuildFrameworkToolsPath = /usr/lib/mono/4.5
MSBuildFrameworkToolsPath32 = /usr/lib/mono/4.5
MSBuildProjectDefaultTargets = Build
MSBuildProjectDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux
MSBuildProjectExtension = .sln
MSBuildProjectFile = Microlise.MonoTemplate.sln
MSBuildProjectFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
MSBuildProjectName = Microlise.MonoTemplate
MSBuildThisFile = Microlise.MonoTemplate.sln
MSBuildThisFileDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
MSBuildThisFileDirectoryNoRoot = home/mjones/workspace/Mono-ServiceTemplate-Linux/
MSBuildThisFileExtension = .sln
MSBuildThisFileFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
MSBuildThisFileName = Microlise.MonoTemplate
MSBuildToolsPath = /usr/lib/mono/xbuild/12.0/bin
MSBuildToolsPath32 = /usr/lib/mono/xbuild/12.0/bin
MSBuildToolsRoot = /usr/lib/mono/xbuild/12.0
MSBuildToolsVersion = 12.0
no_proxy = microlise19,localhost,*.ml.local,127.0.0.1,127.0.1.1*,local.home
OLDPWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux/.nuget
OS = Unix
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Platform = Mixed Platforms
PWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux
SHELL = /bin/bash
SHLVL = 2
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
SSH_CLIENT = 172.17.150.93 56285 22
SSH_CONNECTION = 172.17.150.93 56285 172.17.147.110 22
SSH_TTY = /dev/pts/1
TERM = cygwin
USER = mjones
XDG_RUNTIME_DIR = /run/user/1001
XDG_SESSION_ID = 19
Initial Items:
BuildLevel0
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Microservice/Microlise.MonoTemplate.Microservice.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
BuildLevel1
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Intergration/Microlise.MonoTemplate.Tests.Intergration.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Unit/Microlise.MonoTemplate.Tests.Unit.csproj
ProjectReference
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Microservice/Microlise.MonoTemplate.Microservice.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Intergration/Microlise.MonoTemplate.Tests.Intergration.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Unit/Microlise.MonoTemplate.Tests.Unit.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
Building target "ValidateSolutionConfiguration" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Target ValidateSolutionConfiguration:
Task "Message"
Using task Message from Microsoft.Build.Tasks.Message, Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Building solution configuration "Debug|Mixed Platforms".
Done executing task "Message"
Done building target "ValidateSolutionConfiguration" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln".
Done building target "ValidateSolutionConfiguration" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Building target "Build" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Target Build:
Task "MSBuild"
Using task MSBuild from Microsoft.Build.Tasks.MSBuild, Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Global Properties:
BuildingSolutionFile = true
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
Platform = AnyCPU
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
Project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj" (default target(s)):
Initial Properties:
_ = /usr/bin/xbuild
BuildingSolutionFile = true
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
EnableNuGetPackageRestore = true
ftp_proxy = http://foxy:8080
HOME = /home/mjones
http_proxy = http://foxy:8080
https_proxy = https://foxy:8080
LANG = en_GB.UTF-8
LANGUAGE = en_GB:en
LESSCLOSE = /usr/bin/lesspipe %s %s
LESSOPEN = | /usr/bin/lesspipe %s
LOGNAME = mjones
LS_COLORS = rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL = /var/mail/mjones
MSBuildBinPath = /usr/lib/mono/4.5
MSBuildExtensionsPath = /usr/lib/mono/xbuild
MSBuildExtensionsPath32 = /usr/lib/mono/xbuild
MSBuildExtensionsPath64 = /usr/lib/mono/xbuild
MSBuildProjectDefaultTargets =
MSBuildProjectDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger
MSBuildProjectExtension = .csproj
MSBuildProjectFile = Microlise.MonoTemplate.Logger.csproj
MSBuildProjectFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
MSBuildProjectName = Microlise.MonoTemplate.Logger
MSBuildThisFile = Microlise.MonoTemplate.Logger.csproj
MSBuildThisFileDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/
MSBuildThisFileDirectoryNoRoot = home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/
MSBuildThisFileExtension = .csproj
MSBuildThisFileFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
MSBuildThisFileName = Microlise.MonoTemplate.Logger
MSBuildToolsPath = /usr/lib/mono/4.5
MSBuildToolsRoot = /usr/lib/mono
MSBuildToolsVersion = 4.0
no_proxy = microlise19,localhost,*.ml.local,127.0.0.1,127.0.1.1*,local.home
OLDPWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux/.nuget
OS = Unix
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Platform = AnyCPU
PWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux
SHELL = /bin/bash
SHLVL = 2
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
SSH_CLIENT = 172.17.150.93 56285 22
SSH_CONNECTION = 172.17.150.93 56285 172.17.147.110 22
SSH_TTY = /dev/pts/1
TERM = cygwin
USER = mjones
XDG_RUNTIME_DIR = /run/user/1001
XDG_SESSION_ID = 19
Initial Items:
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj: error : No target found in the project
Done building project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj".-- FAILED
Project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj" (default target(s)):
Initial Properties:
_ = /usr/bin/xbuild
BuildingSolutionFile = true
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
EnableNuGetPackageRestore = true
ftp_proxy = http://foxy:8080
HOME = /home/mjones
http_proxy = http://foxy:8080
https_proxy = https://foxy:8080
LANG = en_GB.UTF-8
LANGUAGE = en_GB:en
LESSCLOSE = /usr/bin/lesspipe %s %s
LESSOPEN = | /usr/bin/lesspipe %s
LOGNAME = mjones
LS_COLORS = rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL = /var/mail/mjones
MSBuildBinPath = /usr/lib/mono/4.5
MSBuildExtensionsPath = /usr/lib/mono/xbuild
MSBuildExtensionsPath32 = /usr/lib/mono/xbuild
MSBuildExtensionsPath64 = /usr/lib/mono/xbuild
MSBuildProjectDefaultTargets =
MSBuildProjectDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers
MSBuildProjectExtension = .csproj
MSBuildProjectFile = Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildProjectFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildProjectName = Microlise.MonoTemplate.Tests.Helpers
MSBuildThisFile = Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildThisFileDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/
MSBuildThisFileDirectoryNoRoot = home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/
MSBuildThisFileExtension = .csproj
MSBuildThisFileFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildThisFileName = Microlise.MonoTemplate.Tests.Helpers
MSBuildToolsPath = /usr/lib/mono/4.5
MSBuildToolsRoot = /usr/lib/mono
MSBuildToolsVersion = 4.0
no_proxy = microlise19,localhost,*.ml.local,127.0.0.1,127.0.1.1*,local.home
OLDPWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux/.nuget
OS = Unix
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Platform = AnyCPU
PWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux
SHELL = /bin/bash
SHLVL = 2
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
SSH_CLIENT = 172.17.150.93 56285 22
SSH_CONNECTION = 172.17.150.93 56285 172.17.147.110 22
SSH_TTY = /dev/pts/1
TERM = cygwin
USER = mjones
XDG_RUNTIME_DIR = /run/user/1001
XDG_SESSION_ID = 19
Initial Items:
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj: error : No target found in the project
Done building project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj".-- FAILED
Task "MSBuild" execution -- FAILED
Done building target "Build" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln".-- FAILED
Done building target "Build" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Done building project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln".-- FAILED
Target performance summary:
12.440 ms ValidateSolutionConfiguration 1 calls
15.775 ms Build 1 calls
Tasks performance summary:
8.211 ms Message 1 calls
14.441 ms MSBuild 1 calls
Build FAILED.
Errors:
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln (default targets) ->
(Build target) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj (default targets) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj: error : No target found in the project
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln (default targets) ->
(Build target) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj (default targets) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj: error : No target found in the project
0 Warning(s)
2 Error(s)
Time Elapsed 00:00:00.1838320
mjones@mlclustervs110:~/workspace/Mono-ServiceTemplate-Linux$
真正奇怪的一点是,我的 csproj 文件开始看起来就像在源代码管理中一样。类似这样的内容(针对字符限制进行了编辑)
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microlise.MonoTemplate.Logger</RootNamespace>
<AssemblyName>Microlise.MonoTemplate.Logger</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
......
但是如果我在构建失败后查看它,它已更改为:
<?xml version="1.0" encoding="utf-8">
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
这就是文件中的全部内容。没有目标,什么都没有。所以在我看来,好像 xbuild/mono 出于某种原因在执行构建时正在修改 csproj 文件?
编辑 2
这是从 Logger 项目导入的\
<Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
好的,所以这都是过时的症状 NuGet.exe。我不确定我使用的版本来自哪里,但我用来恢复包的命令是:
nuget update -safe Microlise.MonoTemplate.sln -repositoryPath ./packages
更新 nuget 后,我现在可以简单地 运行
nuget restore Microlise.MonoTemplate.sln
其他问题都消失了。
我正在尝试在 Ubuntu 14.4 LTS 上使用 xbuild 编译一个项目。我有单声道 4.2.3 和 xbuild 12
整个解决方案之前是在 OSX 上使用 mono 构建的,但我的大学进行了一些更改(例如重命名项目),现在它也无法在 OSX 上构建.我一辈子都弄不明白是什么改变导致了这一切。它在 visual studio 和 Jenkins 上的 msbuild 中继续构建良好。
解决方案中有 5 个项目,最初它们都返回错误
<Projfile>:error : No target found in the project
经过一些谷歌搜索后,我将以下内容添加到我所有的项目文件中。
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)" />
现在,只有 2 个 class 库项目返回此错误。
我已经通过 运行 诊断日志记录检查了我所有的 msbuild 变量是否设置为正确的路径,而且我还发现了一些 SO 帖子,它们会检查是否正确安装了 mono。
我有点不知所措。
编辑
这是请求的输出 运行 /v:diag。
mjones@mlclustervs110:~/workspace/Mono-ServiceTemplate-Linux$ ./debugbuild.sh
Scanning for projects...
Found 5 projects with a packages.config file. (Microlise.MonoTemplate.Logger, Microlise.MonoTemplate.Microservice, Microlise.MonoTemplate.Tests.Helpers, Microlise.MonoTemplate.Tests.Intergration, Microlise.MonoTemplate.Tests.Unit)
Looking for installed packages in 'packages'.
Updating 'Microlise.MonoTemplate.Logger'...
Updating 'Microlise.MonoTemplate.Microservice'...
Updating 'Microlise.MonoTemplate.Tests.Helpers'...
Updating 'Microlise.MonoTemplate.Tests.Intergration'...
Updating 'Microlise.MonoTemplate.Tests.Unit'...
XBuild Engine Version 12.0
Mono, Version 4.2.3.0
Copyright (C) 2005-2013 Various Mono authors
Loading default tasks for ToolsVersion: 4.0 from /usr/lib/mono/4.5/Microsoft.Common.tasks
Build started 01/04/2016 08:30:35.
__________________________________________________
Loading default tasks for ToolsVersion: 12.0 from /usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.tasks
Project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" (default target(s)):
Initial Properties:
_ = /usr/bin/xbuild
AspNetConfiguration = $(Configuration)
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
EnableNuGetPackageRestore = true
ftp_proxy = http://foxy:8080
HOME = /home/mjones
http_proxy = http://foxy:8080
https_proxy = https://foxy:8080
LANG = en_GB.UTF-8
LANGUAGE = en_GB:en
LESSCLOSE = /usr/bin/lesspipe %s %s
LESSOPEN = | /usr/bin/lesspipe %s
LOGNAME = mjones
LS_COLORS = rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL = /var/mail/mjones
MSBuildBinPath = /usr/lib/mono/xbuild/12.0/bin
MSBuildExtensionsPath = /usr/lib/mono/xbuild
MSBuildExtensionsPath32 = /usr/lib/mono/xbuild
MSBuildExtensionsPath64 = /usr/lib/mono/xbuild
MSBuildFrameworkToolsPath = /usr/lib/mono/4.5
MSBuildFrameworkToolsPath32 = /usr/lib/mono/4.5
MSBuildProjectDefaultTargets = Build
MSBuildProjectDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux
MSBuildProjectExtension = .sln
MSBuildProjectFile = Microlise.MonoTemplate.sln
MSBuildProjectFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
MSBuildProjectName = Microlise.MonoTemplate
MSBuildThisFile = Microlise.MonoTemplate.sln
MSBuildThisFileDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
MSBuildThisFileDirectoryNoRoot = home/mjones/workspace/Mono-ServiceTemplate-Linux/
MSBuildThisFileExtension = .sln
MSBuildThisFileFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
MSBuildThisFileName = Microlise.MonoTemplate
MSBuildToolsPath = /usr/lib/mono/xbuild/12.0/bin
MSBuildToolsPath32 = /usr/lib/mono/xbuild/12.0/bin
MSBuildToolsRoot = /usr/lib/mono/xbuild/12.0
MSBuildToolsVersion = 12.0
no_proxy = microlise19,localhost,*.ml.local,127.0.0.1,127.0.1.1*,local.home
OLDPWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux/.nuget
OS = Unix
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Platform = Mixed Platforms
PWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux
SHELL = /bin/bash
SHLVL = 2
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
SSH_CLIENT = 172.17.150.93 56285 22
SSH_CONNECTION = 172.17.150.93 56285 172.17.147.110 22
SSH_TTY = /dev/pts/1
TERM = cygwin
USER = mjones
XDG_RUNTIME_DIR = /run/user/1001
XDG_SESSION_ID = 19
Initial Items:
BuildLevel0
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Microservice/Microlise.MonoTemplate.Microservice.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
BuildLevel1
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Intergration/Microlise.MonoTemplate.Tests.Intergration.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Unit/Microlise.MonoTemplate.Tests.Unit.csproj
ProjectReference
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Microservice/Microlise.MonoTemplate.Microservice.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Intergration/Microlise.MonoTemplate.Tests.Intergration.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Unit/Microlise.MonoTemplate.Tests.Unit.csproj
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
Building target "ValidateSolutionConfiguration" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Target ValidateSolutionConfiguration:
Task "Message"
Using task Message from Microsoft.Build.Tasks.Message, Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Building solution configuration "Debug|Mixed Platforms".
Done executing task "Message"
Done building target "ValidateSolutionConfiguration" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln".
Done building target "ValidateSolutionConfiguration" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Building target "Build" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Target Build:
Task "MSBuild"
Using task MSBuild from Microsoft.Build.Tasks.MSBuild, Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Global Properties:
BuildingSolutionFile = true
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
Platform = AnyCPU
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
Project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj" (default target(s)):
Initial Properties:
_ = /usr/bin/xbuild
BuildingSolutionFile = true
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
EnableNuGetPackageRestore = true
ftp_proxy = http://foxy:8080
HOME = /home/mjones
http_proxy = http://foxy:8080
https_proxy = https://foxy:8080
LANG = en_GB.UTF-8
LANGUAGE = en_GB:en
LESSCLOSE = /usr/bin/lesspipe %s %s
LESSOPEN = | /usr/bin/lesspipe %s
LOGNAME = mjones
LS_COLORS = rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL = /var/mail/mjones
MSBuildBinPath = /usr/lib/mono/4.5
MSBuildExtensionsPath = /usr/lib/mono/xbuild
MSBuildExtensionsPath32 = /usr/lib/mono/xbuild
MSBuildExtensionsPath64 = /usr/lib/mono/xbuild
MSBuildProjectDefaultTargets =
MSBuildProjectDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger
MSBuildProjectExtension = .csproj
MSBuildProjectFile = Microlise.MonoTemplate.Logger.csproj
MSBuildProjectFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
MSBuildProjectName = Microlise.MonoTemplate.Logger
MSBuildThisFile = Microlise.MonoTemplate.Logger.csproj
MSBuildThisFileDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/
MSBuildThisFileDirectoryNoRoot = home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/
MSBuildThisFileExtension = .csproj
MSBuildThisFileFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj
MSBuildThisFileName = Microlise.MonoTemplate.Logger
MSBuildToolsPath = /usr/lib/mono/4.5
MSBuildToolsRoot = /usr/lib/mono
MSBuildToolsVersion = 4.0
no_proxy = microlise19,localhost,*.ml.local,127.0.0.1,127.0.1.1*,local.home
OLDPWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux/.nuget
OS = Unix
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Platform = AnyCPU
PWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux
SHELL = /bin/bash
SHLVL = 2
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
SSH_CLIENT = 172.17.150.93 56285 22
SSH_CONNECTION = 172.17.150.93 56285 172.17.147.110 22
SSH_TTY = /dev/pts/1
TERM = cygwin
USER = mjones
XDG_RUNTIME_DIR = /run/user/1001
XDG_SESSION_ID = 19
Initial Items:
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj: error : No target found in the project
Done building project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj".-- FAILED
Project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj" (default target(s)):
Initial Properties:
_ = /usr/bin/xbuild
BuildingSolutionFile = true
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration xmlns=""><ProjectConfiguration Project="{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{BBF92C72-30BF-46E2-8C09-35D1E4773C82}">Debug|x86</ProjectConfiguration><ProjectConfiguration Project="{2F2DD425-BAE2-46A4-BC3B-C722B0C6E326}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{F9162212-6CE4-4AD5-AFD5-F4AF03D89412}">Debug|AnyCPU</ProjectConfiguration><ProjectConfiguration Project="{AA6310E1-91CF-4392-A4E7-F41493005A55}">Debug|AnyCPU</ProjectConfiguration></SolutionConfiguration>
EnableNuGetPackageRestore = true
ftp_proxy = http://foxy:8080
HOME = /home/mjones
http_proxy = http://foxy:8080
https_proxy = https://foxy:8080
LANG = en_GB.UTF-8
LANGUAGE = en_GB:en
LESSCLOSE = /usr/bin/lesspipe %s %s
LESSOPEN = | /usr/bin/lesspipe %s
LOGNAME = mjones
LS_COLORS = rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL = /var/mail/mjones
MSBuildBinPath = /usr/lib/mono/4.5
MSBuildExtensionsPath = /usr/lib/mono/xbuild
MSBuildExtensionsPath32 = /usr/lib/mono/xbuild
MSBuildExtensionsPath64 = /usr/lib/mono/xbuild
MSBuildProjectDefaultTargets =
MSBuildProjectDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers
MSBuildProjectExtension = .csproj
MSBuildProjectFile = Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildProjectFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildProjectName = Microlise.MonoTemplate.Tests.Helpers
MSBuildThisFile = Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildThisFileDirectory = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/
MSBuildThisFileDirectoryNoRoot = home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/
MSBuildThisFileExtension = .csproj
MSBuildThisFileFullPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj
MSBuildThisFileName = Microlise.MonoTemplate.Tests.Helpers
MSBuildToolsPath = /usr/lib/mono/4.5
MSBuildToolsRoot = /usr/lib/mono
MSBuildToolsVersion = 4.0
no_proxy = microlise19,localhost,*.ml.local,127.0.0.1,127.0.1.1*,local.home
OLDPWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux/.nuget
OS = Unix
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Platform = AnyCPU
PWD = /home/mjones/workspace/Mono-ServiceTemplate-Linux
SHELL = /bin/bash
SHLVL = 2
SolutionDir = /home/mjones/workspace/Mono-ServiceTemplate-Linux/
SolutionExt = .sln
SolutionFileName = Microlise.MonoTemplate.sln
SolutionName = Microlise.MonoTemplate
SolutionPath = /home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln
SSH_CLIENT = 172.17.150.93 56285 22
SSH_CONNECTION = 172.17.150.93 56285 172.17.147.110 22
SSH_TTY = /dev/pts/1
TERM = cygwin
USER = mjones
XDG_RUNTIME_DIR = /run/user/1001
XDG_SESSION_ID = 19
Initial Items:
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj: error : No target found in the project
Done building project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj".-- FAILED
Task "MSBuild" execution -- FAILED
Done building target "Build" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln".-- FAILED
Done building target "Build" in project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln" ("/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln").
Done building project "/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln".-- FAILED
Target performance summary:
12.440 ms ValidateSolutionConfiguration 1 calls
15.775 ms Build 1 calls
Tasks performance summary:
8.211 ms Message 1 calls
14.441 ms MSBuild 1 calls
Build FAILED.
Errors:
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln (default targets) ->
(Build target) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj (default targets) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Logger/Microlise.MonoTemplate.Logger.csproj: error : No target found in the project
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.sln (default targets) ->
(Build target) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj (default targets) ->
/home/mjones/workspace/Mono-ServiceTemplate-Linux/Microlise.MonoTemplate.Tests.Helpers/Microlise.MonoTemplate.Tests.Helpers.csproj: error : No target found in the project
0 Warning(s)
2 Error(s)
Time Elapsed 00:00:00.1838320
mjones@mlclustervs110:~/workspace/Mono-ServiceTemplate-Linux$
真正奇怪的一点是,我的 csproj 文件开始看起来就像在源代码管理中一样。类似这样的内容(针对字符限制进行了编辑)
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DAA924E0-7C89-4E49-B1C6-28B66ABAC229}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microlise.MonoTemplate.Logger</RootNamespace>
<AssemblyName>Microlise.MonoTemplate.Logger</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
......
但是如果我在构建失败后查看它,它已更改为:
<?xml version="1.0" encoding="utf-8">
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
这就是文件中的全部内容。没有目标,什么都没有。所以在我看来,好像 xbuild/mono 出于某种原因在执行构建时正在修改 csproj 文件?
编辑 2
这是从 Logger 项目导入的\
<Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
好的,所以这都是过时的症状 NuGet.exe。我不确定我使用的版本来自哪里,但我用来恢复包的命令是:
nuget update -safe Microlise.MonoTemplate.sln -repositoryPath ./packages
更新 nuget 后,我现在可以简单地 运行
nuget restore Microlise.MonoTemplate.sln
其他问题都消失了。