.net core 提前加载程序集
Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute
<ItemGroup>
<AssemblyAttribute Include="Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute">
<_Parameter1>Adnc.Demo.Usr.Application</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
测试
string appname = "Adnc.Demo.Usr.Api"; Assembly assembly2 = Assembly.Load(new AssemblyName(appname)); var array = assembly2.GetCustomAttributes<ApplicationPartAttribute>();
.NET Core Web APi类库内嵌运行的方法_实用技巧_脚本之家 (jb51.net)

浙公网安备 33010602011771号