【问题标题】:Is Web.Config in WCF Service Application project incorrect?WCF 服务应用程序项目中的 Web.Config 是否不正确?
【发布时间】:2023-03-21 03:45:01
【问题描述】:

我想使用 Visual Studio 2010 创建一个 WCF 服务应用程序。创建项目后,我有 2 个配置文件: 1.Web.Debug.config 2. Web.Release.config

这是文件中的代码。

<?xml version="1.0"?>

    <!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

    <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">


    </configuration>

当我尝试添加任何元素或属性时,它会给出以下警告。

Could not find schema information for the attribute 'address'.
Could not find schema information for the attribute 'address'.
Could not find schema information for the attribute 'binding'.
Could not find schema information for the attribute 'binding'.
Could not find schema information for the attribute 'contract'.
Could not find schema information for the attribute 'contract'.
Could not find schema information for the attribute 'name'.
Could not find schema information for the element 'endpoint'.
Could not find schema information for the element 'endpoint'.
Could not find schema information for the element 'service'.
Could not find schema information for the element 'services'.

我做错了什么? 有什么要添加或编辑的。我正在尝试创建一个非常简单的 WCF 服务应用程序。

【问题讨论】:

    标签: c# asp.net xml visual-studio wcf


    【解决方案1】:

    如果这是 wcf 主机使用的配置文件,那么您将丢失整个 system.serviceModel。通过创建新的 WCF 服务或至少使用 Tools|Wcf Configuration Editor 来重新生成文件可能会更好。我认为您移动了一些东西并且您的文件放错了位置。

    【讨论】:

    • 谢谢!我是愚蠢的。它们是 3 个配置文件。我没有检查的第三个有 serviceModel。还是谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-08
    • 2013-09-30
    • 1970-01-01
    相关资源
    最近更新 更多