是否可以为非dotnet DLL创建Nuget包?

是否可以为非dotnet DLL创建Nuget包?,nuget,nuget-package,Nuget,Nuget Package,只是一个普通无聊的DLL,不是作为.Net项目创建的,它需要某种版本控制。是否可以使用Nuget工具为此创建Nuget包?您可以将任何文件作为内容添加到Nuget包中。它将被复制到项目输出中 您可以在这里查看: 示例nuspec: <?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> &l

只是一个普通无聊的DLL,不是作为.Net项目创建的,它需要某种版本控制。是否可以使用Nuget工具为此创建Nuget包?

您可以将任何文件作为内容添加到Nuget包中。它将被复制到项目输出中

您可以在这里查看:

示例nuspec:

  <?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    <id>PackageId</id>
    <version>1.0.0</version>
    <authors>Example</authors>
    <owners>Example</owners>
    <dependencies>
    </dependencies>
   <contentFiles>
    <files include="any/any/yourdllfolder/**/*" buildAction="None" copyToOutput="true" />      
   </contentFiles>
  </metadata>
</package>

此DLL是用什么语言创建的?C++?回答你的问题:如果你不知道,DLL不可能用任何.NET语言编写:可能是C++。这不是我们已经写的东西,我们没有源代码,它本身在Nuget上也不可用。我只是想确定,如果/当新版本可用时,我们不会突然遇到版本冲突问题。这似乎需要某个.Net项目,您希望在其中打包其他文件,不是吗?我不是这个意思。不,你不需要任何.net项目。您只需将内容文件复制到给定路径any/any/yourdllfolder下即可。然后你可以用nuget.exe打包。然后你就有了你的nupkg,你可以把它推到任何nuget服务器上