0

I'm trying to build a NuGet package with static files (js, CSS and images) that can be referenced as a package in a web project. I want these files to get published to the publish directory when publish even is triggered.

My .nuspec config is

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata minClientVersion="3.3.0">
    <id>Test.Assets.Develop</id>
    <version>1.0.0</version>
    <authors>Bev</authors>
    <owners>Bev</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Assets</description>
    <copyright>Copyright 2017</copyright>
    <contentFiles>
            <files include="contentFiles\any\any\assets\**" buildAction="Content" copyToOutput="true" flatten="false" />
    </contentFiles>
  </metadata>
  <files>
        <file src="build\assets\**" target="contentFiles\any\any\assets"/>
  </files>
</package>

My static files gets published to <outputdir>/bin folder instead of <outputdir>.

Bevin
  • 173
  • 2
  • 15

1 Answers1

0

As per MS documentation contents should be copied to content folder within nuget package.

Refer here: https://learn.microsoft.com/en-us/nuget/create-packages/creating-a-package

content files can be placed at content folder You could use something like this:

  <files>
       <file src="build\assets\**" target="content\" />
  </files>