带有msbuild脚本的意外令牌? [英] Unexpected token with msbuild script?

查看:70
本文介绍了带有msbuild脚本的意外令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试运行构建文件时收到以下错误消息:

I get the following error message when trying to run a build file:

错误MSB4025:无法加载项目文件. '?'是你吗 预期令牌.预期的令牌是>".

error MSB4025: The project file could not be loaded. '?' is an u nexpected token. The expected token is ''>''.

以下是构建脚本:

<?xml version="1.0" encoding="utf-8" ?/>

<Project ToolsVersion="3.5" DefaultTarget="Compile"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == " ">Debug</Configuration>
</PropertyGroup>

<ItemGroup>
<SolutionRoot Include=".."/>
<BuildArtifacts Include=".\buildartifacts\"/>
<SolutionFile Include="..\ScrewTurnWiki.sln"/>
</ItemGroup>

<Target Name="Clean">
<RemoveDir Directories="@(BuildArtifacts)"/>
</Target>

<Target Name="Init" DependsOnTargets="Clean">
<MakeDir Directories="@(BuildArtifacts)"/>
</Target>

<Target Name="Compile" DependsOnTargets="Init">
<MSBuild Projects="@(SolutionFile)"Properties="OutDir=%(BuildArtifacts.FullPath);   
    Configuration=$(Configuration)"/>
</Target>

</Project>

第1行,位置38表示错误所在.

Line 1, Position 38 is where it says the error is.

在修复第一个错误后,又弹出了另一个错误:

Another error just popped up after fixing the first one:

第1行,位置53表示名称不能以''字符开头....

Line 1, Postion 53 says Name cannot begin with the '"' character....

推荐答案

我认为xml标头必须是 <?xml version="1.0" encoding="utf-8" ?>代替<?xml version="1.0" encoding="utf-8" ?/>

I think the xml header must be <?xml version="1.0" encoding="utf-8" ?> instead of <?xml version="1.0" encoding="utf-8" ?/>

这篇关于带有msbuild脚本的意外令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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