.net NET项目如何添加C++/NuGet的CLI库?

.net NET项目如何添加C++/NuGet的CLI库?,.net,nuget,c++-cli,nuget-server,.net,Nuget,C++ Cli,Nuget Server,我的项目结构是: 主要项目为.NETFramework4.8,库采用C++/CLI开发。 我可以直接添加文件引用,现在可以工作了 由于某些原因,我们不想引用该文件,因此我们希望使用NuGet获取库 我已将包发布到我们的私有NuGet提要,但当我从NuGet安装包时,它显示错误: Could not install package 'MyLib 1.0.3'. You are trying to install this package into a project that targets '.

我的项目结构是: 主要项目为.NETFramework4.8,库采用C++/CLI开发。 我可以直接添加文件引用,现在可以工作了

由于某些原因,我们不想引用该文件,因此我们希望使用NuGet获取库

我已将包发布到我们的私有NuGet提要,但当我从NuGet安装包时,它显示错误:

Could not install package 'MyLib 1.0.3'. You are trying to install this package into a project that targets '.NETFramework, Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
附言: 我已将“.NET Framework目标版本”设置为“v4.8”

这是我的.nuspec文件:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>MyLib</id>
    <version>1.0.3</version>
    <authors>MyCompany</authors>
    <owners>MyCompany</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>lib for Windows</description>
    <releaseNotes>This is the test publish.</releaseNotes>
    <copyright>Copyright 2019</copyright>
    <tags>lib native</tags>
  </metadata>
</package>

给我们看看你创建的.nuspec文件,你肯定会有人指指点点,大声说“好了!”我已经解决了。我发现lib.dll应该放在“lib”中。
\build
    \net48
        \MyLib.dll