Home > Net >  Nuget packages for a c # project reference, how to add a batch file automatically copied to the outp
Nuget packages for a c # project reference, how to add a batch file automatically copied to the outp

Time:11-15

Environment: VS2017 or VS2019 NUGET. Exe4.7 WPF netframework4.5.2
Problem: its own building a NuGet server, needs to be a common DLL project on the server for other project references, the project contains some static files (such as batch files, configuration files, etc.), automatic reference to the destination output directory of the project,
I try to edit the nuspec file, add contentFiles nodes, found nupkg is the static files inside, but is not directly copied to the target output directory of the project, the Internet some method, found that also not line,
 
& lt; ? The XML version="1.0" encoding="utf-8"?>
& lt; Package XMLNS="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd" & gt;
& lt; Metadata>
& lt; Id> XLY. GuardService
& lt; Version> 1.0.15 & lt;/version>
& lt; title> XLY. GuardService
& lt; Authors> XLY Salvationdata Technology INC., & lt;/authors>
& lt; ReleaseNotes> & lt;/releaseNotes>
& lt; ContentFiles>
& lt;/GuardInstall files include="* */*" buildAction="None" flatten="false" copyToOutput="true"/& gt;
& lt;/contentFiles>
& lt;/metadata>
& lt;/package>


What is the problem? What's the solution?

CodePudding user response:

Included in the project, right-click in the solution, file attributes, copy to always copying,
  • Related