I built my solution properly in Visual Studio, but when I build with TFS, I have several errors such as:
path\file.cs (8, 47)
path\file.cs(8,47): Error CS1002: ; expected
path\file.cs (8, 85)
path\file.cs(8,85): Error CS1519: Invalid token '(' in class, struct, or interface member declaration
namespace path
{
public class file : Ifile
{
public IContactService ContactService => Locator.GetService<IContactService>();
public IAddressService AddressService => Locator.GetService<IAddressService>();
}
}
Thank you for helping me!
public IContactService ContactService => Locator.GetService<IContactService>();
This is an expression-bodied property and is implemented only in CSC 6 and later. Your TFS is probably running CSC 5 or earlier. You have to change it to:
public IContactService ContactService
{
get { return Locator.GetService<IContactService>(); }
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.