我尝试使用 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/