Abp Core framework refers to the pit of third-party class libraries

Abp framework references the pit of third-party class libraries

Introduction to pits referencing third-party class libraries

ERROR 2018-05-01 11:35:21,047 [10   ] Mvc.ExceptionHandling.AbpExceptionFilter - Could not load file or assembly 'aliyun-net-sdk-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'. 系统找不到指定的文件。
System.IO.FileNotFoundException: Could not load file or assembly 'aliyun-net-sdk-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'. 系统找不到指定的文件。
File name: 'aliyun-net-sdk-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
   at ABP.Probation.Sms.AliyunSmsSender.SendSmsAsync(SmsMessage smsMessage)
   at ABP.Probation.Sms.Send.SmsService.<SendCaptchaSms>d__5.MoveNext() in C:\Source\ABP-Core-Angular-Code\src\ABP.Probation.Application\Sms\Send\SmsService.cs:line 112

If you encounter this error, don't worry, this is because of a bug in .net core 2.0. After a series of Baidu, I found that a great article pointed out that the problem of updating .net core 2.0.3 was perfectly solved

Based on the principle of believing in the Great God, Ben Xiaobai went to github to update to asp.net 2.0.7.

asp.net core sdk download address


I downloaded the latest version 2.0.7


After downloading and installing, you need to modify the configuration of the class library


Add the following to the configuration file

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.7" />
  </ItemGroup>

Finally, the main event is here. The startup project still reports an error. I don’t know why the great god can solve it. Maybe there is a problem with my Alibaba Cloud SMS SDK. Finally, I use the nuget package to solve the problem that the assembly cannot be found when referring to a third-party library. After Make unremitting efforts to find the Alibaba Cloud SMS SDK uploaded by the great god in the nuget package, download the reference, and solve it perfectly. Let me tell you the operation method below.


To sum up, there are still bugs in .net core 2.0 referencing third-party class library assemblies, which can only be solved by referencing projects or nuget packages. I hope .net core 2.1 can solve this problem.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325772060&siteId=291194637