2017-09-26 11 views
0

私は私のプロジェクトファイルをパッケージ化しようとすると、このような何か使用してnugetパッケージ作成しています:構成= $(ConfigurationName)-p NuGetパックfile.csprojを。 -NoPackageAnalysisプットファイルとフォルダ

しかし、問題は、それが「LIB」フォルダに「コンテンツ」にフォルダやアセンブリをプロジェクトに関連するファイル/フォルダを入れているが、私のようなビンフォルダ何かに根とライブラリ内のファイル/フォルダをしたいですこの 。私nuspecファイルの構造は

でも第二の画像に示されているのと同じ出力構造体の私nuspecファイル結果から を除く
<?xml version="1.0"?> 
<package > 
    <metadata> 
     <id>$id$</id> 
     <version>$version$</version> 
     <title>$title$</title> 
     <authors>abc</authors> 
     <owners>abc</owners> 
     <requireLicenseAcceptance>false</requireLicenseAcceptance> 
     <description>abc</description> 
     <releaseNotes></releaseNotes> 
     <copyright>Copyright 9999</copyright> 
     <tags></tags> 
    </metadata> 
    <files> 
     <file src="bin\**" target="bin" /> 
     <file src="$target$\**\*.*" target=""/> 
    </files> 
</package> 

ある enter image description here

enter image description here しかし、今、私のフォルダ構造はこれです。私はナゲットバージョン4.1.0を使用しており、また、2.8.6のような旧バージョンのナゲットで試してみました。

答えて

-1

あなたは私もこれで苦労したカスタム.nuspecファイル

<?xml version="1.0"?> 
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> 
    <metadata> 
     <id>title</id> 
     <version>1.0.0</version> 
     <authors>abc</authors> 
     <requireLicenseAcceptance>false</requireLicenseAcceptance> 
     <description>desc</description> 
    </metadata> 
    <files> 
     <file src="bin\Debug\bin\*.*" target="bin" /> 
     <file src="bin\Debug\fonts\*.*" target="fonts" /> 
     ............ 
    </files> 
</package> 
0

を作成する必要がありますが、/package<files />コレクションと/package/metadata<contentFiles />コレクションの違いを理解することが重要です。

<files />コレクションは、あなたのパッケージのlibcontentまたはtoolsディレクトリに、あなたのパッケージに入れてファイルパッケージャを伝えます。

注:このコレクションを使用する必要はありません。a convention-based working directoryも使用できます。

<contentFiles />コレクションはパッケージ消費者パッケージに含まれるファイルを使用する方法に指示します。

あなたのケースでは.nuspecファイルは、しかし、この($target$部分については本当にわからないようなものになります。

<?xml version="1.0"?> 
<package > 
    <metadata> 
     <id>$id$</id> 
     <version>$version$</version> 
     <title>$title$</title> 
     <authors>abc</authors> 
     <owners>abc</owners> 
     <requireLicenseAcceptance>false</requireLicenseAcceptance> 
     <description>abc</description> 
     <releaseNotes></releaseNotes> 
     <copyright>Copyright 9999</copyright> 
     <tags></tags> 
     <contentFiles> 
      <files include="bin/**" buildAction="None" copyToOutput="true" /> 
     </contentFiles> 
    </metadata> 
    <files> 
     <file src="bin\**" target="content\bin" /> 
     <file src="$target$\**\*.*" target="content"/> 
    </files> 
</package> 
+0

にこの答えを有望に思えたが、 'contentFiles'が実際には異なる概念であるようです。ここでは、emgartenのコメントを参照してください: https://github.com/NuGet/Home/issues/2060 私はあなたの答えを試みたが、悲しいことにそれは動作しませんでした –

関連する問題