为什么我收到所需的属性'名'在我的Web.Release.config缺少警示XML的文档,转换文件? [英] Why am I receiving the required attribute 'name' is missing warning in my Web.Release.config XML-Document-Transform file?

本文介绍了为什么我收到所需的属性'名'在我的Web.Release.config缺少警示XML的文档,转换文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除我的 Web.Release.config 文件所有服务端点mexHttpBinding 节点。结果


我发现这个答案


<子>的(我从我的code文件复制,因此它的实际格式不同于答案)

I'm trying to remove all service endpoint mexHttpBinding nodes in my Web.Release.config file.

I found this answer:
(I copied from my code file, so it's actually formatted differently than the answer )

<services>
    <service>

        <endpoint binding="mexHttpBinding"
                  xdt:Locator="Match(binding)"
                  xdt:Transform="RemoveAll" />

    </service>
</services>



警告我收到是在 &LT;服务与GT; 节点:


The warning I am receiving is on the <service> node:

必需的属性'名'缺失。

The required attribute 'name' is missing.



我是否需要添加一个空字符串或通配符的(如果有)的的 名称 的属性< STRONG> &LT;服务与GT; 节点来解决此警告?



此外,应该不是上述变换用包裹在 &LT; system.serviceModel&GT; 节点,或者没有


Do I need to add an empty string or wildcard ( if there is one ) to the name attribute of the <service> node to resolve this warning?

Also, shouldn't the above transform be wrapped with the <system.serviceModel> node, or no?

推荐答案

这只是一个验证警告,因为你的XML是不符合模式的验证要求。它并不真正意味着什么和转换往往是无效的完整的XML模式,因为他们,就其性质而言,往往是局部的定义。转型仍然可以工作。属性中被忽略变换,除非您指定它们作为XDT的一部分转换的条件。

That's just a validation warning, because your xml is not meeting the validation requirements of the schema. It doesn't really mean anything and transforms are often not valid to the full xml schema because they, by their nature, are often partial definitions. The transformation will still work. Attributes are ignored in the transform unless you specify them as part of the xdt transform conditions.

是的,你确实需要&LT; system.serviceModel方式&gt; 元素

如果你只想错误走开,你可以设置服务名=您在您的项目有一个服务名称,但它不会影响到转型,它仍然会适用于所有的服务,因为该名称将是忽略(除非你把XDT:与name属性服务元素定位器约束)。

If you just want the error to go away, you can set service name = to a service name that you have in your project, but it will not affect the transformation, it will still apply to all services because the name will be ignored (unless you put a xdt:locator constraint on the service element with the name property).

这可能会造成混淆不过,如果其他人要维护它。这可能是最好保留警告和评论,或把名字和评论它,无论哪种方式。

It might be confusing though, if other people have to maintain it. It might be better to leave the warning and comment it, or put the name and comment it, either way.

应当注意的是,这些仅仅是<青霉>编辑的警告。他们不是编译器或运行时警告。他们只显示当你在编辑器中打开该文件,他们只是智能感知的警告,让他们对你的应用程序的质量没有真正的影响或建立

It should be noted that these are only editor warnings. They are not compiler or runtime warnings. They only show up when you have the file open in the editor, and they are only intellisense warnings, so they have no real affect on the quality of your application or build.

这篇关于为什么我收到所需的属性'名'在我的Web.Release.config缺少警示XML的文档,转换文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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