How to get rid of nuget warnings when using a nuspec file?
I have the following directory structure:
C:xyzAutomation [master ≡ +2 ~0 -0 !]> dir -Recurse -File -Name
.gitattributes
.gitignore
BuildBootstrap.ps1
BuildBuild.ps1
BuildDevOpsAutomation.nuspec
vNextConfig.ps1
vNextQueryBuildDefinition.ps1
vNextQueueBuild.ps1
vNext.vscodelaunch.json
C:xyzAutomation [master ≡ +2 ~0 -0 !]>
My goal is to produce a NuGet package with everything except for the following items:
- **/.git* - this should exclude both the .git folder and any .gitXYZ files anywhere
- **/.vs* - should cover the folders .vs and .vscode anywhere
- Build - should cover the root Build folder
The BuildDevOpsAutomation.nuspec is:
<?xml version="1.0"?>
<package >
<metadata>
<id>DevOpsAutomation</id>
<version>$version$</version>
<title>DevOps Automation</title>
<authors>Arch DevOps</authors>
<owners>xyz</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains various scripts to automate vNext and Octopus pipelines.</description>
<copyright>Copyright 2018</copyright>
<tags>vnext vsts tfs octopus automation</tags>
</metadata>
<files>
<file src="**" exclude="Build/**;**/.git/**;**/.vs*/**"/>
</files>
</package>
The command line is:
nuget pack BuildDevOpsAutomation.nuspec -BasePath '.' -Version '1.0.0.0' -NoPackageAnalysis
And it seems to work:
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> del .DevOpsAutomation.1.0.0.nupkg
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> $nuget
C:Usersme.nugetnuget.exe
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> &$nuget pack BuildDevOpsAutomation.nuspec -Version '1.0.0.0' -BasePath '.' -NoPackageAnalysis
Attempting to build package from 'DevOpsAutomation.nuspec'.
WARNING: NU5119: File 'C:xyzAutomation.gitattributes' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
WARNING: NU5119: File 'C:xyzAutomation.gitignore' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
C:xyzAutomation [master ≡ +3 ~1 -0 ~]>
The produced nupkg contains just what I need, which is currently only the vNext folder. However, the warnings annoy me. Is it possible to suppress them, preferably from within the nuspec file itself?
nuget nuspec
add a comment |
I have the following directory structure:
C:xyzAutomation [master ≡ +2 ~0 -0 !]> dir -Recurse -File -Name
.gitattributes
.gitignore
BuildBootstrap.ps1
BuildBuild.ps1
BuildDevOpsAutomation.nuspec
vNextConfig.ps1
vNextQueryBuildDefinition.ps1
vNextQueueBuild.ps1
vNext.vscodelaunch.json
C:xyzAutomation [master ≡ +2 ~0 -0 !]>
My goal is to produce a NuGet package with everything except for the following items:
- **/.git* - this should exclude both the .git folder and any .gitXYZ files anywhere
- **/.vs* - should cover the folders .vs and .vscode anywhere
- Build - should cover the root Build folder
The BuildDevOpsAutomation.nuspec is:
<?xml version="1.0"?>
<package >
<metadata>
<id>DevOpsAutomation</id>
<version>$version$</version>
<title>DevOps Automation</title>
<authors>Arch DevOps</authors>
<owners>xyz</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains various scripts to automate vNext and Octopus pipelines.</description>
<copyright>Copyright 2018</copyright>
<tags>vnext vsts tfs octopus automation</tags>
</metadata>
<files>
<file src="**" exclude="Build/**;**/.git/**;**/.vs*/**"/>
</files>
</package>
The command line is:
nuget pack BuildDevOpsAutomation.nuspec -BasePath '.' -Version '1.0.0.0' -NoPackageAnalysis
And it seems to work:
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> del .DevOpsAutomation.1.0.0.nupkg
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> $nuget
C:Usersme.nugetnuget.exe
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> &$nuget pack BuildDevOpsAutomation.nuspec -Version '1.0.0.0' -BasePath '.' -NoPackageAnalysis
Attempting to build package from 'DevOpsAutomation.nuspec'.
WARNING: NU5119: File 'C:xyzAutomation.gitattributes' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
WARNING: NU5119: File 'C:xyzAutomation.gitignore' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
C:xyzAutomation [master ≡ +3 ~1 -0 ~]>
The produced nupkg contains just what I need, which is currently only the vNext folder. However, the warnings annoy me. Is it possible to suppress them, preferably from within the nuspec file itself?
nuget nuspec
add a comment |
I have the following directory structure:
C:xyzAutomation [master ≡ +2 ~0 -0 !]> dir -Recurse -File -Name
.gitattributes
.gitignore
BuildBootstrap.ps1
BuildBuild.ps1
BuildDevOpsAutomation.nuspec
vNextConfig.ps1
vNextQueryBuildDefinition.ps1
vNextQueueBuild.ps1
vNext.vscodelaunch.json
C:xyzAutomation [master ≡ +2 ~0 -0 !]>
My goal is to produce a NuGet package with everything except for the following items:
- **/.git* - this should exclude both the .git folder and any .gitXYZ files anywhere
- **/.vs* - should cover the folders .vs and .vscode anywhere
- Build - should cover the root Build folder
The BuildDevOpsAutomation.nuspec is:
<?xml version="1.0"?>
<package >
<metadata>
<id>DevOpsAutomation</id>
<version>$version$</version>
<title>DevOps Automation</title>
<authors>Arch DevOps</authors>
<owners>xyz</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains various scripts to automate vNext and Octopus pipelines.</description>
<copyright>Copyright 2018</copyright>
<tags>vnext vsts tfs octopus automation</tags>
</metadata>
<files>
<file src="**" exclude="Build/**;**/.git/**;**/.vs*/**"/>
</files>
</package>
The command line is:
nuget pack BuildDevOpsAutomation.nuspec -BasePath '.' -Version '1.0.0.0' -NoPackageAnalysis
And it seems to work:
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> del .DevOpsAutomation.1.0.0.nupkg
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> $nuget
C:Usersme.nugetnuget.exe
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> &$nuget pack BuildDevOpsAutomation.nuspec -Version '1.0.0.0' -BasePath '.' -NoPackageAnalysis
Attempting to build package from 'DevOpsAutomation.nuspec'.
WARNING: NU5119: File 'C:xyzAutomation.gitattributes' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
WARNING: NU5119: File 'C:xyzAutomation.gitignore' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
C:xyzAutomation [master ≡ +3 ~1 -0 ~]>
The produced nupkg contains just what I need, which is currently only the vNext folder. However, the warnings annoy me. Is it possible to suppress them, preferably from within the nuspec file itself?
nuget nuspec
I have the following directory structure:
C:xyzAutomation [master ≡ +2 ~0 -0 !]> dir -Recurse -File -Name
.gitattributes
.gitignore
BuildBootstrap.ps1
BuildBuild.ps1
BuildDevOpsAutomation.nuspec
vNextConfig.ps1
vNextQueryBuildDefinition.ps1
vNextQueueBuild.ps1
vNext.vscodelaunch.json
C:xyzAutomation [master ≡ +2 ~0 -0 !]>
My goal is to produce a NuGet package with everything except for the following items:
- **/.git* - this should exclude both the .git folder and any .gitXYZ files anywhere
- **/.vs* - should cover the folders .vs and .vscode anywhere
- Build - should cover the root Build folder
The BuildDevOpsAutomation.nuspec is:
<?xml version="1.0"?>
<package >
<metadata>
<id>DevOpsAutomation</id>
<version>$version$</version>
<title>DevOps Automation</title>
<authors>Arch DevOps</authors>
<owners>xyz</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains various scripts to automate vNext and Octopus pipelines.</description>
<copyright>Copyright 2018</copyright>
<tags>vnext vsts tfs octopus automation</tags>
</metadata>
<files>
<file src="**" exclude="Build/**;**/.git/**;**/.vs*/**"/>
</files>
</package>
The command line is:
nuget pack BuildDevOpsAutomation.nuspec -BasePath '.' -Version '1.0.0.0' -NoPackageAnalysis
And it seems to work:
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> del .DevOpsAutomation.1.0.0.nupkg
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> $nuget
C:Usersme.nugetnuget.exe
C:xyzAutomation [master ≡ +3 ~1 -0 ~]> &$nuget pack BuildDevOpsAutomation.nuspec -Version '1.0.0.0' -BasePath '.' -NoPackageAnalysis
Attempting to build package from 'DevOpsAutomation.nuspec'.
WARNING: NU5119: File 'C:xyzAutomation.gitattributes' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
WARNING: NU5119: File 'C:xyzAutomation.gitignore' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline
C:xyzAutomation [master ≡ +3 ~1 -0 ~]>
The produced nupkg contains just what I need, which is currently only the vNext folder. However, the warnings annoy me. Is it possible to suppress them, preferably from within the nuspec file itself?
nuget nuspec
nuget nuspec
asked Nov 11 '18 at 20:09
mark
19.4k56186373
19.4k56186373
add a comment |
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53252756%2fhow-to-get-rid-of-nuget-warnings-when-using-a-nuspec-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53252756%2fhow-to-get-rid-of-nuget-warnings-when-using-a-nuspec-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown