【发布时间】:2017-08-16 23:22:13
【问题描述】:
我有一个类似这样的 something.csproj 项目:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.1.0" />
</ItemGroup>
</Project>
还有一个类似这样的 something.cs 程序:
using System;
using System.IO;
using System.Data.SqlClient;
namespace SomethingNS
{
public class Something
{
public static void Main()
{
var a = new SqlCommand();
}
}
}
使用 dotnet 2.0,我执行:
dotnet publish
但我在文件夹\bin\Debug\netcoreapp1.0\publish\System.Data.SqlClient.dll 中看不到System.Data.SqlClient.dll?
这是为什么呢?
【问题讨论】:
-
如果我使用
Version="4.4.0"而不是Version="4.1.0",它确实会显示在那里 -
WAG,但请检查您的 GAC 以查看您是否安装了 4.1.0。
-
我在
C:\Windows\assembly中没有看到该 dll 的任何版本。 (这就是我在 GAC 中查看的地方,对吗?)但我确实在%userprofile%\.nuget\packages\system.data.sqlclient中看到了不同的版本@ -
Welp,如果你搜索了整个 GAC 并没有找到它,那么我的 AG 有点太 W了。祝你好运。
-
@Will .NET Core 应用程序不使用 GAC。
标签: .net-core