Skip to content

Instantly share code, notes, and snippets.

@kingofnull
Last active June 6, 2022 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingofnull/784dd39d34099ebc1a7d0de75c66a4f0 to your computer and use it in GitHub Desktop.
Save kingofnull/784dd39d34099ebc1a7d0de75c66a4f0 to your computer and use it in GitHub Desktop.
NuGet package auto build dll and publish in Ms Windows and VS2019 using a batch file (set project name and api key then run it in project directory next to .csprj file)
@echo off
del *.nupkg
set API_KEY= <---API-KEY--->
set PRJ_FILE= <---Project-Name--->.csproj
REM nuget pack -Build "%PRJ_FILE%" -Symbols -IncludeReferencedProjects -properties Configuration=Release -Properties NoWarn=NU5128
nuget pack -Build "%PRJ_FILE%" -IncludeReferencedProjects -properties Configuration=Release -Properties NoWarn=NU5128
Nuget push *.nupkg -Source https://www.nuget.org/api/v2/package %API_KEY%
pause
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>MSS</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<!-- <icon>icon.png</icon> -->
<!-- <projectUrl>http://project_url_here_or_delete_this_line/</projectUrl> -->
<description>$description$</description>
<!-- <releaseNotes>Summary of changes made in this release of the package.</releaseNotes> -->
<copyright>$copyright$</copyright>
<!-- <tags>Tag1 Tag2</tags> -->
<dependencies>
<group targetFramework=".NETFramework4.5" />
</dependencies>
</metadata>
</package>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment