NuLink 0.1.0-beta2
dotnet tool install --global NuLink --version 0.1.0-beta2
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local NuLink --version 0.1.0-beta2
#tool dotnet:?package=NuLink&version=0.1.0-beta2&prerelease
nuke :add-package NuLink --version 0.1.0-beta2
NuLink allows consuming NuGet packages from source code on local machine. This creates seamless environment where packages can be developed and tested as if their code was part of the main project. Learn more on GitHub
Getting started
Supported types of projects
- .NET Core and NETStandard projects and packages ("SDK/PackageReference-style")
- New in Beta 2: .NET Framework projects and packages ("packages.config-style")
Prerequisites
- Linux, macOS, or Windows
- .NET Core SDK 2.1+ (not tested on 3.0 yet)
Installing
$ dotnet tool install -g NuLink --version 0.1.0-beta2
Linking a package to local sources
Prior to linking, make sure these conditions are met:
- package must be first restored from a NuGet feed (this limitation will be removed in upcoming versions)
- package source project must be located on the local machine
- either
dotnet restore
ordotnet build
must be run at least once on the package project
In terminal, go to directory of project/solution that consumes the package, and run:
$ nulink link -p My.Package -l /path/to/my/package/source/My.Package.csproj
In this example, all consumers of My.Package will start using binaries from /path/to/my/package/source/bin/Debug
.
See Usage instructions for more info.
How it works
NuLink creates symbolic links to consume binaries of selected packages directly from their compilation directories in the local file system.
For SDK/PackageReference-style projects (.NET Core or NETStandard)
Original Linked
-------------------- ----------------------
~ or %UserProfile% working directory
| |
+- .nuget/ +- My.Package/
| |
+- packages/ +- Source/
| |
+- my.package/ +- My.Package.csproj
| |
+- 1.0.5/ +- bin/
| |
+- lib >---> SYMLINK >---> +- Debug/
| |
+-X- netstandard2.0/ +-V- netstandard2.0/
In this example, every time My.Package.csproj
is compiled, the latest binaries from its bin/Debug
are automatically used by all consumers. Since .pdb in bin/Debug
maps the binaries to local sources, code navigation and debugging on consumer side work seamlessly with the latest changes in package code.
For packages.config-style projects (.NET Framework)
Original Linked
-------------------- ----------------------
consumer working directory
|
+- Source\ package working directory
| |
+- consumer-solution.sln +- My.Package
| |
+- packages\ +- Source\
| |
+- My.Package.1.0.5\ +- My.Package.csproj
| |
+- lib\ +- bin\
| |
+- net45 >---> SYMLINK >---> +- Debug\
This example works mostly like the previous one, except that the link only affects a specific consumer solution. This is because in .NET Framework projects, packages are copied under a solution-level packages
folder, whereas in the new SDK-style projects, .NET looks for packages in the user-level cache.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
0.1.0-beta2 | 775 | 8/20/2019 |
0.1.0-beta1 | 379 | 5/27/2019 |
0.1.0-alpha3 | 344 | 5/12/2019 |
0.1.0-alpha2 | 352 | 5/8/2019 |