Skip to content

Reproducing bootstrap's nuspec elegance #41208

Answered by julien-deramond
palmem29 asked this question in Q&A
Discussion options

You must be logged in to vote

I'm far from being a NuGet expert, but I think the key to deploying content files in NuGet packages is to include them in both content and contentFiles paths in your .nuspec file; something like:

<package>
  <metadata>
    <!-- ... other metadata ... -->
    <contentFiles>
      <files include="**/*" />
    </contentFiles>
  </metadata>
  <files>
    <!-- For traditional .NET Framework projects -->
    <file src="your\source\*.css" target="content\Content" />
    <file src="your\source\*.js" target="content\Scripts" />

    <!-- For modern SDK-style projects -->
    <file src="your\source\*.css" target="contentFiles\any\any\css" />
    <file src="your\source\*.js" target="contentFiles\any…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@palmem29
Comment options

Answer selected by palmem29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants