xml nant 和 ó 字符

标签 xml utf-8 msbuild nant nantcontrib

我尝试使用 nant 通过 msbuild 构建解决方案。问题是解决方案的目录是:

C:\Repositorio\Proyectos Casino\SPPM\Codificación\PokerManager

如你所见,它有一个特殊字符 ó

这是我的构建文件

<?xml version="1.0" encoding="ascii"?>
<project name="Simple" default="copy">
<property name="nantcontrib-dir"
   value="${path::combine(nant::get-base-directory(), '..\..\nantcontrib-0.85')}" overwrite="false" />

<property name="dest-dir"
   value="C:\temp\nant\table\full-release" overwrite="true" />

<property name="remote-dir"
   value="C:\temp\nant\table\full-release" overwrite="true" />


<property name="cleandir"
   value="C:\temp\nant\table" overwrite="false" />



<property name="pm-soldir"
   value ="C:\Repositorio\Proyectos Casino\SPPM\Codificación\PokerManager\PokerManager.sln" />



<loadtasks assembly=
    "${path::combine(nantcontrib-dir,'bin/NAnt.Contrib.Tasks.dll')}" 
 /> 
<target name="build-PokerManager"
        description="Builds all C# code">

<property name="nant.settings.currentframework" value="net-4.0"/>
  <msbuild project="${pm-soldir}">
    <property name="Configuration"
              value="release" />
    <property name="OutputPath" value="${dest-dir}"/>

  </msbuild>
</target>


<target name="copy" depends="build-PokerManager">
     <copy todir="${remote-dir}">
    <fileset basedir="${dest-dir}">
        <include name="**/*" />
    </fileset>
</copy>
    </target>



</project>

当我运行它时,我得到

构建PokerManager:

BUILD FAILED

C:\Juan Pablo\Release Maker\ForTablet\NAnt\table-releases.build(30,4):
'C:\Repositorio\Proyectos Casino\SPPM\Codifica
ci?n\PokerManager\PokerManager.sln' is not a valid value for attribute 'project'
 of <msbuild ... />.
    not valid characters in path..

Total time: 0.1 seconds.

我尝试过使用 utf-8 和 unicode,但没有成功

提前致谢

最佳答案

UTF-8 编码应该可以工作,但您的系统中可能有某些东西不喜欢处理它?<​​/p>

在没有UTF-8的情况下,你尝试过实体编码吗?

ó 字符将编码为 Ó 的 XML 实体代码。无论字符编码是什么,这都应该在您的 XML 中起作用。

(但不要只是用字符串替换该一个字符——使用正确的实体编码函数,这样您就可以确保捕获现在或将来潜伏的任何其他杂散字符)

关于xml nant 和 ó 字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7083599/

相关文章:

xml - 使用 xpath 设置节点的文本值

java - 使用 Eclipse 的 xml 智能感知?

Python - 将 xml 中的特定行转换为小写并写回 - utf-8 问题

xml - Xpath 选择包含特定列表子集的元素

C#反序列化XML到对象

utf-8 - 如何在不使用平台特定功能的情况下打印 UTF-8 字符串?

java - 在 UTF-8 编码代码中,使用带重音字符的字符串,该字符串取自以 ISO-8859-1 编码的文件

C# 项目 (.CSProj),链接到具有平面目录结构的文件

msbuild - web.config转换在构建服务器上不起作用

MSBUILD 发布不发布 xsd 架构文件