2016-11-23 4 views
3

csprojファイルからNugetパッケージを作成しようとしています。このパッケージには、ツールフォルダにinstall.ps1スクリプトが含まれ、コンテンツフォルダにはいくつかのファイルが含まれます。csprojからパッケージングするときにNuGetツールフォルダが含まれています

しかし、csprojファイルからパッケージングするときのように、Nugetはパッケージ情報(説明、タグなど)を対応するnuspecファイルから取得しますが、それ以外のものは取得しません。これは、nuspecファイルと同じディレクトリにあるツールフォルダとコンテンツフォルダを無視します。

このようにしてnugetをパッケージ化すると、nuspecファイルのcontentFilesセクションに含まれるファイルも無視されるようです。

これが期待どおりの動作ですか?そうであれば、私はcsprojからパッケージを作成し、コンテンツとツールのフォルダをパッケージに入れる方法がありますか?

nuspecファイルのみを使用できますが、これはうまくいくはずですが、私はこの方法を構築し、依存関係を手動で管理しようとしている複数のパッケージを手に入れています。

マイnuspecファイルNuGet 3.4.4.1321を実行

<?xml version="1.0"?> 
<package> 
    <metadata> 
    <id>$id$</id> 
    <version>$version$</version> 
    <title>$id$</title> 
    <authors>authors</authors> 
    <owners>$owners$</owners> 
    <projectUrl>http://dummy.url</projectUrl> 
    <requireLicenseAcceptance>false</requireLicenseAcceptance> 
    <description>the description</description> 
    <copyright>$copyright$</copyright> 
    <releaseNotes>$releaseNotes$</releaseNotes> 
    <contentFiles> 
     <files include="content\App.config.install.xdt"/> 
     <files include="content\App.config.uninstall.xdt"/> 
     <files include="temp\App.config"/> 
    </contentFiles> 
    <tags>wpf testing</tags> 
    </metadata> 
</package> 
+0

あなたnuspecファイルをしてください投稿することができますか? –

答えて

0

は、このためのマニュアルは私を少し混乱が判明します。コンテンツファイルは、ファイルを置き換えるものではありません。 NuGet 3では、両方を同時に使用できます。

nuspecファイル内のmetadataタグの外側にあるFilesタグを使用すると、ツールとコンテンツフォルダに入る項目を指定することができました。

更新nuspec:

<?xml version="1.0"?> 
<package> 
    <metadata> 
    <id>$id$</id> 
    <version>$version$</version> 
    <title>$id$</title> 
    <authors>authors</authors> 
    <owners>$owners$</owners> 
    <projectUrl>http://dummy.url</projectUrl> 
    <requireLicenseAcceptance>false</requireLicenseAcceptance> 
    <description>the description</description> 
    <copyright>$copyright$</copyright> 
    <releaseNotes>$releaseNotes$</releaseNotes> 
    <tags>wpf testing</tags> 
    </metadata> 
<files> 
    <file src="App.config.install.xdt" target="content"/> 
    <file src="App.config.uninstall.xdt" target="content"/> 
    <file src="tools\install.ps1" target="tools"/> 
    </files> 
</package> 

がうまくいけば、これは誰がここでドキュメントに巻きトリップした場合などに役立ちます。

これ以上の議論はNuGet Issueにあります。

関連する問題