Azure 应用服务在 GitHub 上构建和部署失败

时间:2021-04-14 17:23:25

标签: c# azure github build

我刚刚将一个非常基本的 Xamarin 移动应用程序上传到了 git hub。我使用 azure 选项来设置要构建和部署的服务。不幸的是,GitHub 构建在 IOS 和 Android 项目中都失败了,因为同样的错误:错误:

<块引用>

D:\a\MobileApplication\MobileApplication\MobileApplication\MobileApplication\Services\EventMockData.cs(65>,1):错误 CS1022:类型或命名空间定义,或预期的文件结尾 >[D:\a\ MobileApplication\MobileApplication\MobileApplication\MobileApplication\MobileApplication.csproj]

我找不到 EventMockData.cs 文件的任何问题。并且整个项目在我本地的 VS 中成功构建。

using MobileApplication.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace MobileApplication.Services
{
    class EventMockData : IDataStore<Event>
    {
        readonly List<Event> events;

        public EventMockData()
        {
            events = new List<Event>()
            {
                new Event { id = 1,
                    eventName = "Sunday School", 
                    eventContactName = "John",
                    eventContactEmail = "john@test.com",
                    eventContactPhone = 1234567890,
                    eventImageUrl = "https://wwww.dell.com",
                    eventStartDateTime = new DateTime(2021, 04, 30, 13, 00, 00), 
                    eventEndDateTime = new DateTime(2021, 04, 30, 20, 00, 00), 
                    eventRecurrance = "daily", 
                    eventRecurranceInterval = 1, 
                    eventRecurrenceDayInterval = ""}
            };
        }
        public async Task<bool> AddItemAsync(Event item)
        {
            events.Add(item);

            return await Task.FromResult(true);
        }

        public async Task<bool> UpdateItemAsync(Event item)
        {
            var oldItem = events.Where(e => e.id == item.id).FirstOrDefault(); 
            events.Remove(oldItem);
            events.Add(item);

            return await Task.FromResult(true);
        }

        public async Task<bool> DeleteItemAsync(int id)
        {
            var oldItem = events.Where((Event arg) => arg.id == id).FirstOrDefault();
            events.Remove(oldItem);

            return await Task.FromResult(true);
        }

        public async Task<Event> GetItemAsync(int id)
        {
            return await Task.FromResult(events.FirstOrDefault(s => s.id == id));
        }

        public async Task<IEnumerable<Event>> GetItemsAsync(bool forceRefresh = false)
        {
            return await Task.FromResult(events);
        }
    }
}

0 个答案:

没有答案