1

这与我之前的问题有关,我认为这可能是由这个问题引起的。

我添加了一项新服务以将 varbinary 添加到我的数据库表中:Afbeeldingen

  • 编号:整数
  • afbeelding1:varbinary(max)

我制定了这样的服务合同:

[OperationContract]
public void setAfbeelding(Afbeelding a)
{
    dc.Afbeeldings.InsertOnSubmit(a);
    dc.SubmitChanges();
}

我编译了项目,将服务引用添加到我的主项目中,然后出现以下错误:

Custom tool warning: Unable to load one or more of the requested
types. Retrieve the LoaderExceptions property for more information.

Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Exception has been thrown by the target of an invocation.
XPath to Error Source: //wsdl:definitions[@targetNamespace='']/wsdl:portType[@name='EditAfbeeldingService']

....

服务参考错误

我设法通过调整这里解释的参考来解决这个问题。但我不认为这是健康的,我认为它现在让我对我正在尝试做的事情感到困惑。('OndernemersAward.EditAfbeeldingServiceReference.Binary' 不包含带有 1 个参数的构造函数,这是我得到的错误)

我真的希望有人能提供帮助,到目前为止,silverlight 和 WCF 对我来说是一团糟。提前谢谢你,Thomas

4

0 回答 0