Fix "Unable to Find Package" NuGet Error in Visual Studio C#
Microsoft introduced linking commands in the NTFS-based Operating systems after Windows NT 4.0 and Windows 2000. As a result, the MS-DOS operating system did not support any links. These Links show the relationship between different entities by seamlessly pointing and redirecting one entity and its content to another entity with no special handling needed. You can think links are like pointers pointing to files or directories.
These linking commands in the Windows OS include HardLinks, Symbolic Links, and Junction Links. These links are extremely useful; they allow you to avoid having multiple copies of the same file while still accessing the same file content from different folders with different names.
Links can be created in Linux and Unix operating systems, but this article will discuss the differences between symbolic links and junction links in Windows OS. When newcomers first learned about links, they were puzzled by these commands. Don't worry, ourtechroom will assist you.
Let's look first at Junction Links:
With the introduction of Links tools in the Windows Operating System, Junction Links was introduced. As a result, it is only compatible with Windows 2000 and later. It appears to be Windows OS legacy links. Junction Links uses an implementation of an NTFS feature called reparse points to perform links.
Junction Links is a link tool that allows you to create a link to a folder/directory only on the same or different local volume (drive letter) on the same computer or indifferent
external hard drive. So your folders located in one location can be accessed from multiple partitions or volumes in your hard drive.
Keep the following points in mind when working with Junction.
Warning! Do not create junctions pointing to folders on removable drives such as USB pen drives and SD cards, and do so as soon as possible for system-critical folders; otherwise, applications may stop working or Windows may not even start.
With the help of Junction we can do as follows:
With the help of Junction links we cannot do the following and give you an error:
We can use the mlink command to create Junction links as follow:
In this example, we are relocating the folder "C:\My Web Sites" to "D:\Target Folder." When anything software or users tries to access directories within "C:\My Web Sites" Windows will redirect the user and grab the files from "D:\Target Folder" instead. As a result, the space on your C drive is unused and free, and it can be used for something else.
But if you already have the Target Folder name in D drive then you cannot create Links and will get an error message like "Cannot" create a file when that file already exists" as shown below.
So, the target folder must be different. So, we have selected the folder name "New Target Folder" in the D drive and this folder is not reserved in the D partition. So, let's run the command below:
Then junction is created as shown below in Windows Explorer. It will have small shortcut icons in Junction Folder Link.
Here, we can see the junction folder as <Junction>, and these links take up no space.
Symbolic Links is compatible with Windows Vista (Desktop Environment), Windows Server 2008 (Server Environment), and subsequent Windows operating systems. It is more sophisticated than Junction Links.
Symbolic Links are advanced Link tools and commands that allow you to create a link to a folder/file on your local computer or a remote computer (using SMB paths to point at targets across a network). However, keep in mind that any local or network computer that uses Symbolic Links must be running Windows Vista, Windows Server 2008, or later. Symbolic Links work for both relative path and absolute path.
With the help of Symbolic Links you can do as follows:
With the help of Symbolic links we cannot do the following and give you an error:
ie. Users cannot access that network symlinks.
When I make a symbolic link, I make a file/folder with a path to another file/folder ( which might be another symbolic link as well). Symbolic Links are simply the name of another file, symbolic links can span different supported file systems. As a result, symbolic links can exist across filesystems.
Microsoft introduced Symbolic Links to be more compatible with Unix. From Microsoft Official Site: "Symbolic links are designed to aid in migration and application compatibility with UNIX operating systems. Microsoft has implemented symbolic links to function just like UNIX links."
We can use the mlink command to create Junction links for the folder as follow:
In this example, we are relocating the folder "C:\Program FilesSoftware" to "D:\MySoftware." When anything software or user tries to access directories within "C:\Program FilesSoftware," Windows will redirect the user and grab the files from "D:\MySoftware" instead. As a result, the space on your C drive is unused and free, and it can be used for something else.
So, if you change the content in Symbolic links(D:\MySoftware) will auto changes in the target folder ie. Software.
Junction Links and Symbolic Links seem to have similar features. But there are some noticeable differences and they are as follows:
Junction Links | Symbolic Links |
Introduced in Windows 2000 OS and compatible to Windows with Windows 2000 and beyond. | Introduced with Windows Vista and Windows Server 2008. So, compatible with Windows those OS and beyond. |
Junction Links works only for directories. | Symbolic Links work for both directories and files. |
Junctions links work only for the absolute path. | Symbolic Links works for both absolute and relative path. |
Junction Links work for the local drives volumes and partition only | Symbolic Links works for local as well as remote drives. |
Creating junction links does not require any special permissions, and Windows Standard User is sufficient. As a result, we can say it has a low-security profile. | Creating Symbolic Links requires Administrator privileges. Therefore it has high-security profiles. |
It is a legacy Links type created for the NTFS file system. | It is modern links types and was developed to support migration and application compatibility with UNIX operating systems. |
To Delete the Junction link you can use the RD command. | To Delete the Symbolic link you can use RD or del command. |
Junction Links is supported on Windows 2000 and above. | Symbolic Links is supported on Windows Vista and above. |
Right-click on symbolically linked folders/files and select Properties; this displays the shortcut properties of the currently selected files.
Right-click on files created by junction links and select Properties; this displays the original directory folder properties.
Conclusion:
Junction Links and Symbolic Links are useful tools for creating links between folders/files.