【问题标题】:Difference between 2003 and current MSBuild schemas?2003 和当前 MSBuild 架构之间的区别?
【发布时间】:2017-02-13 08:26:33
【问题描述】:

我们的项目文件已经存在了一段时间,其中包括xmlns="http://schemas.microsoft.com/developer/msbuild/2003">。我试图弄清楚如何执行substring match in a CONDITION,所以我想我会查看架构,看看是否有什么东西跳出来。

尝试获取架构会导致 404:

$ wget http://schemas.microsoft.com/developer/msbuild/2003
--2016-10-04 22:44:43--  http://schemas.microsoft.com/developer/msbuild/2003
Resolving schemas.microsoft.com (schemas.microsoft.com)... 65.54.226.187
Connecting to schemas.microsoft.com (schemas.microsoft.com)|65.54.226.187|:80... connected.
HTTP request sent, awaiting response... 404 Not Found

当我在 Web 浏览器中访问时,Microsoft 向我返回了以下消息,表明架构曾经可用但不再可用:

您要查找的资源已被删除,有它的名字 已更改,或暂时不可用。

Microsoft 在MSBuild Project File Schema Reference 有文档,但它没有列出可用的架构、架构的 URL 或它们之间的区别。

我猜我们应该使用 2003 模式,因为它似乎已被弃用或撤回,但除此之外我不知道更多。我的问题是:

  • 我们应该使用什么架构?
  • 架构的 URL 是什么?
  • 2003 架构与我应该使用的架构之间有什么区别?

现在我们正在尝试与 AppVeyor 集成,这些版本似乎更加相关。我们遇到了自动化测试问题(Can't perform 64-bit testing under AppVeyor?Why does AppVeyor use VS2010 tools for VS2015 image?),AppVeyor 支持建议更改 XML 标头中的版本号。下面是一个典型的 VCXPROJ 文件的头部。

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

【问题讨论】:

    标签: xml windows visual-studio xsd msbuild


    【解决方案1】:

    Visual Studio 2015(可能还有其他版本)的 XML 编辑器在 %InstallRoot%\Xml\Schemas 中提供本地模式缓存。在那里寻找msbuild.xsd

    如果微软在命名空间 URI 中提供它会很好,

    http://schemas.microsoft.com/developer/msbuild/2003
    

    但是XML namespace name URIs need not be retrievable。注意上面的命名空间URI仍然是current as of Visual Studio 2015

    【讨论】:

    • 谢谢@kjhughes,你是对的。 %InstallRoot%\Xml\Schemas 里有一堆东西。不幸的是,没有2003200520082010 等。我们项目的最低 Visual Studio 版本是 VS 2010。我们应该在 VS2010 中使用什么架构?我意识到我可以使用 2003 年的版本,但我很乐意使用具有更多功能的版本,因为我们多年来一直在升级。
    • 使用 2003 版,直到 Microsoft 提供更适合您的更新版。但是请注意,有一种观点认为稳定的命名空间不应该随着版本而改变。例如,您会在 HTML 的 W3C 命名空间 (http://www.w3.org/1999/xhtml) 中看到这一点。 XSD 的最新版本不一定对应于更新的命名空间 URI。
    猜你喜欢
    • 2011-11-29
    • 2011-11-14
    • 2019-06-28
    • 2022-01-18
    • 2011-08-15
    • 2010-11-07
    • 1970-01-01
    • 1970-01-01
    • 2022-11-03
    相关资源
    最近更新 更多