.net - dotnet pack ouput and Visual Studio's local package source -
i trying use dotnet pack
create nuget package , copy nuget packages folder used nuget source in visual studio. before dotnet
used dnu pack
creating nuget packages. command created folder project version lib
folder, .nuspec
, .nupkg
, .nupkg.sha512
files.
when dotnet
introduced, migrated , after packing got 2 files, .nupkg
, .symbols.nupkg
. if copy folder used in visual studio nuget source, not recognised.
what missing? using version 1.0.0-preview3-003171 of .net core.
here's how handle packages locally in development environment:
step 1: set local nuget source. need copy of nuget cli if don't have it. follow instructions on creating local nuget feed: basically, create empty folder. chose c:\users\nate\documents\localnuget
.
step 2: add packages local source nuget add [file] -source [folder]
. added environment variable called local_nuget_path
pointed folder wouldn't have type time:
> setx local_nuget_path "c:\users\<you>\documents\localnuget"
for more convenience, wrote simple powershell cmdlet add packages automatically:
nuget-functions.ps1
function nuget-addlocal { param([string]$file) nuget add $file -source $env:local_nuget_path } function nuget-addalllocal { param([string]$path) get-childitem $path -recurse -filter *.nupkg | ` foreach-object { nuget-addlocal $_.fullname } }
add powershell profile available in every console window:
> notepad $profile
add line profile.ps1
(substituting real path of file):
. c:\users\<you>\documents\nuget-functions.ps1
step 3: add local source nuget feed.
> nuget sources add -name local -source $env:local_nuget_path
step 4: profit!
produce packages , add them local source in 2 simple steps:
> dotnet pack > nuget-addalllocal
Comments
Post a Comment