IN ASP.NET 3.5 I am getting the above error when I try to compile the web service project of a Silverlight application
The code line generating the error is below ' 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]
}
}
This is the method it is referencing:
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;
}
I've seen several explanations and tried the suggested fixes, but none of them have worked.
Any help would be appreciated. Many thanks, Mike Thomas