我正在尝试编写一个Msbuild脚本,该脚本将检索在subversion中保存到本地路径的解决方案,然后构建解决方案。
从命令行执行时,我收到错误 - MSB4060该元素无法识别,或在此上下文中不受支持。任何指针都会非常感激。
<project name="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003>">
<PropertyGroup>
<RepositoryPath>http://Path<RepositoryPath>
<svnUsername>USERNAME</svnUsername>
<svnPassword>PASSWORD</svnPassword>
<LocalPath>LOCAL_PATH_TO_COMPILE_SOLUTION</LocalPath>
<solutionFileName>SOLUTION_FILENAME</solutionFileName>
</PropertyGroup>
<!--<ItemGroup>
</ItemGroup>-->
<Import Project="C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<Target Name="GetSource">
<Message Text="Checking out trunk into $(LocalPath)" />
<SvnCheckout RepositoryPath="$(RepositoryPath)"
LocalPath="$(LocalPath)"
UserName="$(svnUsername)"
Password="$(svnPassword)">
<Output TaskParameter="Revision" PropertyName="Revision" />
</SvnCheckout>
<Message Text="Have got revision: $(Revision)"/>
</Target>
<Target Name="Build" DependsOnTargets="GetSource;Clean;" />
<Target Name="Clean">
<MSBuild Projects="$(LocalPath)$(solutionFileName)" Targets="Clean;Rebuild" />
</Target>
</project>
答案 0 :(得分:1)
Project
根元素而不是小写project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
(即在关闭引号之前删除>
)RepositoryPath
即。 - 只生成有效的MSBUILD XML项目