我收到错误“最佳重载方法匹配有一些无效参数”
我的代码是,
System.Collections.Generic.List<ConsultantShares> consultantShareList = (Session["ProjectShare"] as List<ConsultantShares>);
CIService.CIServiceClient client = new CIService.CIServiceClient();
client.GetConsultantScoreAsync(consultantShareList,this.txtProjectId.Text,this.ddlWorkClass.SelectedValue);
client.GetConsultantScoreCompleted += new EventHandler<CIService.GetConsultantScoreCompletedEventArgs>(client_GetConsultantScoreCompleted);
错误列表为,
Error 196 The best overloaded method match for
'CIService.CIServiceClient.GetConsultantScoreAsync(InspectionServices.ConsultantShares[], string, string)'
has some invalid arguments G:\Design Scoring\InspectionEvaluation\Summary.aspx.cs 32
9 G:\Design Scoring\InspectionEvaluation\
Error 197 Argument 1: cannot convert from 'System.Collections.Generic.List<InspectionServices.ConsultantShares>'
to 'InspectionServices.ConsultantShares[]' G:\Design Scoring\InspectionEvaluation\Summary.aspx.cs 32
40 G:\Design Scoring\InspectionEvaluation\
虽然我有以下内容,
在
namespace CIService
{
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
[DebuggerStepThrough]
public class CIServiceClient : ClientBase<ICIService>, ICIService
{
public void GetConsultantScoreAsync(ConsultantShares[] cs, string targetProjectId, string workclass);
public void GetConsultantScoreAsync(ConsultantShares[] cs, string targetProjectId, string workclass, object userState);
}
}
希望你的建议
谢谢
编辑:
出现错误
Error 30 The type or namespace name 'InventoryProject' does not exist in the namespace 'CIService' (are you missing an assembly reference?) G:\Design Scoring\InspectionEvaluation\ProjectDetails.aspx.cs 108 23 G:\Design Scoring\InspectionEvaluation\
CIService.InventoryProject invProject = new CIService.InventoryProject();
而 CIService
public InventoryProject GetInventoryProjectDetail(string consultantId, string projectId)
{
ProjectService prjService = new ProjectService();
return prjService.GetInventoryProjectDetail(consultantId, projectId);
}
public List<InventoryProject> GetProjectsByConsultant(string consultantId, int currentPageNumber, int pageSize)
{
ProjectService prjService = new ProjectService();
return prjService.GetProjectsByConsultant(consultantId, currentPageNumber, pageSize);
}
而 CIService 是我的 WCF 服务,而 InventoryProject.datasource 是数据库管理器的其他一些项目,其 dll 正在此 wcf 项目中使用,但为什么它无法识别“inventoryproject”
希望能得到您的帮助