Visual Studion 2017 Asp.Net Core项目不会在构建时复制依赖的dll文件

问题描述 投票:2回答:1

Visual Studio 2017 Asp.Net Core项目不会将构建中的依赖dll文件复制到bin文件夹中。这只发生在发布上。

在.Net Core之前我可以“复制本地”依赖的dll。

如何向Visual Studio解释它应该将nuget包dll复制到bin文件夹中?

Packages

Package options

c# dll asp.net-core
1个回答
2
投票

请在Visual Studio外的任何文本编辑器上打开您的csproj文件。

您可以看到下一行代码:

<PropertyGroup>
  <TargetFramework>netcoreapp2.0</TargetFramework>      
</PropertyGroup>

只需将PropertyGroup部分更改为:

<PropertyGroup>
  <TargetFramework>netcoreapp2.0</TargetFramework>
  <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

更多详情,你可以查看herehere

© www.soinside.com 2019 - 2024. All rights reserved.