似乎MSbuild没有很多关于如何从svn签出项目并存储并构建它的良好文档,我下载了MSbuild社区,并且不确定代码中的哪个位置我做错了。这是我的代码示例
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project=
"C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<Target Name="GetSource">
<Message Text="Checking out trunk into $(SourceDirectory)" />
<SvnCheckout RepositoryPath="https://server/svn/project"
LocalPath="C:\TestForm\TestSVN"
UserName="myUserName"
Password="myPassword">
<Output TaskParameter="Revision" PropertyName="Revision" />
</SvnCheckout>
<Message Text="Have got revision: $(Revision)"/>
</Target>
<Target Name="Build" DependsOnTargets="GetSource;" />
</Project>
当我从命令行“msbuild”
调用时,我收到错误这是错误的样子
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: The "S
vnCheckout" task failed unexpectedly.\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: System
.Exception: Could not find svn.exe. Looked in PATH locations and various commo
n folders inside Program Files.\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: at
MSBuild.Community.Tasks.Subversion.SvnClient.FindToolPath(String toolName)\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: at
MSBuild.Community.Tasks.Subversion.SvnClient.GenerateFullPathToTool()\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: at
Microsoft.Build.Utilities.ToolTask.ComputePathToTool()\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: at
Microsoft.Build.Utilities.ToolTask.Execute()\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: at
MSBuild.Community.Tasks.Subversion.SvnClient.Execute()\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutio
nHost.Execute()\r
c:\TestForm\LoadSVN.csproj(10,13): error MSB4018: at
Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
答案 0 :(得分:0)
我发现导致问题的问题。安装SVN时确保检查了要安装的命令行选项,默认情况下取消选中,这导致不安装导致错误的svn.exe