【发布时间】:2009-07-27 22:03:26
【问题描述】:
在 ASP.NET 3.5 中,当我尝试编译 Silverlight 应用程序的 Web 服务项目时出现上述错误
产生错误的代码行在'public List GetAccounts();'下面
namespace BegSilver.Web
{
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Service1
{
[OperationContract]
public List<Accounts> GetAccounts();
// Add more operations here and mark them with [OperationContract]
}
}
这是它引用的方法:
public class Accounts
{
private Int32 acpk {get; set;}
private Decimal acctnumber { get; set; }
private String name { get; set; }
private String type { get; set; }
public static List<Accounts> GetAccounts()
{
List<Accounts> a = new List<Accounts>();
a.Add(
new Accounts()
{
acpk = 1,
acctnumber = 332.3m,
name = "Test",
type = "CASH"
});
return a;
}
我已经看过几种解释并尝试了建议的修复方法,但都没有奏效。
任何帮助将不胜感激。 非常感谢, 迈克·托马斯
【问题讨论】:
标签: c# asp.net silverlight