netcore类库编译时生成所依赖的所有程序集文件到目录下
netcore,设置类库在编译时,生成所有依赖的dll到目录下
在项目文件中增加配置:
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
如:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> </PropertyGroup> <ItemGroup> <PackageReference Include="MySql.Data" Version="8.0.28" /> </ItemGroup> </Project>
更多分享,请大家关注我的个人公众号: