Nuget Package不包括self作为依赖项

时间:2017-04-26 19:24:26

标签: c# nuget generator t4 nuspec

我正在从类库中创建一个nuget包。我有明确的包含文件工作正常,但我的DLL没有包含在包中。我的印象是默认情况下nuget包会将自己包含在包中的dll中我可能会弄错。我的nuspec文件看起来像这样:

<?xml version="1.0"?>
  <package >
    <metadata>
      <id>DTOCodeGenerator</id>
      <version>1.0.0.1</version>
      <title>DTO Code Generator</title>
      <authors>Short Circuit</authors>
      <owners>J5</owners>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
      <description>DTO Code Generator Includes the needed include tt files to generate interface backed DTO's with adapter generation</description>
      <releaseNotes></releaseNotes>
      <copyright>Copyright 2017</copyright>
      <tags>DTOGenerator T4</tags>
      <dependencies>
        <dependency id="EntireOne.Shared.T4" version="2.0.10.24" />
      </dependencies>
    </metadata>
    <files>
      <file src="T4Generators\AutoMapperExtensions.ttinclude" target="content\T4Generators\AutoMapperExtensions.ttinclude"/>
      <file src="T4Generators\ConstGenerator.ttinclude" target="content\T4Generators\ConstGenerator.ttinclude"/>
      <file src="T4Generators\DTOGenerator.ttinclude" target="content\T4Generators\DTOGenerator.ttinclude"/>
      <file src="T4Generators\EnumGenerator.ttinclude" target="content\T4Generators\EnumGenerator.ttinclude"/>
    </files>
  </package>

如何将当前的dll添加到nuget包

1 个答案:

答案 0 :(得分:1)

如果其他人想知道您要做的就是在文件中添加另一行并像这样引用您的dll:

<file src="bin\Debug\DTOCodeGenerator.dll" target="lib"/>