【问题标题】:Error: Unable to generate a temporary class (result=1) … When Invoking Methods on a Web Service错误:无法生成临时类 (result=1) … 在 Web 服务上调用方法时
【发布时间】:2014-07-03 13:47:53
【问题描述】:

我使用 SOAP Asp 实现。 Net 3.5 和 VS2013 Express,一个遗留系统。

有一个 web-service 运行的站点运行良好,但是在发布到服务器时会产生以下错误。一定有什么问题?

Server was unable to process request. ---> Unable to generate a temporary class (result=1).
error CS0272: The property or indexer 'SGR.Modelo.Servicos.IntegracaoMovimentacao.MovimentoDTO.Totalizacao' cannot be used in this context because the set accessor is inaccessible
error CS0272: The property or indexer 'SGR.Modelo.Servicos.IntegracaoMovimentacao.MovimentoDTO.Totalizacao' cannot be used in this context because the set accessor is inaccessible

Descrição: Ocorreu uma exceção sem tratamento durante a execução da atual solicitação da Web. Examine o rastreamento de pilha para obter mais informações sobre o erro e onde foi originado no código. 

Detalhes da Exceção: System.ServiceModel.FaultException: Server was unable to process request. ---> Unable to generate a temporary class (result=1).
error CS0272: The property or indexer 'SGR.Modelo.Servicos.IntegracaoMovimentacao.MovimentoDTO.Totalizacao' cannot be used in this context because the set accessor is inaccessible
error CS0272: The property or indexer 'SGR.Modelo.Servicos.IntegracaoMovimentacao.MovimentoDTO.Totalizacao' cannot be used in this context because the set accessor is inaccessible

【问题讨论】:

  • 那么,你试过我的答案了吗?

标签: c# asp.net web-services


【解决方案1】:

嗯,我不知道为什么它在你的工作机器上工作而不是在生产服务器上工作,但对于 ASp.NET WebServices 工作,他们需要属性获取器是public

public string MyProperty{ get; set; }

如果你有这样的东西,它不会起作用:

public string MyProperty{ get; private set; }

这也行不通:

protected string MyProperty{ get; set; }

希望对你有帮助。

【讨论】:

    猜你喜欢
    • 2011-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多