System.Private.Uri-System.BadImageFormatException

时间:2019-11-03 02:53:37

标签: c# asp.net-core-2.2

我有一个已在生产中运行的应用程序,昨天我再次打开了代码并开始运行并显示错误:

System.BadImageFormatException: 'Could not load file or assembly 'System.Private.Uri, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Format of the executable (.exe) or library (.dll) is invalid.'
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace Jonav.SmsUI
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }
}

有人经历过吗?你是怎么解决的?

编辑:我没有直接引用System.Private.Uri

enter image description here

0 个答案:

没有答案