Tag: 位 服务

字段初始值设定项无法引用非静态字段,方法或属性

以下是我的代码: private BitsManager manager; private const string DisplayName = “Test Job”; public SyncHelper() { manager = new BitsManager(); } BitsJob uploadBitsJob = manager.CreateJob(DisplayName, JobType.Upload); 我收到以下错误: A field initializer cannot reference the non-static field, method, or property ‘BITSIntegrationModule.SyncService.SyncHelper.manager’