If a library (eg, on github) doesn't distribute itself via a nuget package, I'd have to manually include it as a reference, correct? I see a lot of reference posts for how to add a reference to a project for Visual Studio, but I can't seem to figure out how to do it on Visual Studio Code.
In this case, I've downloaded the library's zip, and moved the expanded folder into my project, and then tried using <namespace>
, which did not work.
EDIT:
I noticed that this downloaded zip contained a .nuspec
. Is there something I can do with this file extension to import it in my project?
You add references to a shared project just as you would a normal project reference. In Visual Studio or Fire, you right-click the "References" node of the real project and choose "Add Reference", and then pick the shared project from the list.
If you're using Visual Basic, select the References page, and then click the Reference Paths button. In the Reference Paths dialog box, type the path of the folder that contains the item you want to reference in the Folder field, and then click the Add Folder button.
Add a second project From the right-click or context menu of Solution 'QuickSolution' in Solution Explorer, select Add > New Project. In the Add a new project dialog box, enter the text unit test into the search box at the top, and then select C# under Language.
Let's say you have two projects:
1) Project1.Api
2) Project2.Executable
Command line syntax for dotnet add reference
:
cd Project2.Executable
dotnet add reference ../Project1.Api/Project1.Api.csproj
If you check the Project2.Executable.csproj file, you will see the following entry:
<ItemGroup>
<ProjectReference Include = "..\Project1.Api\Project1.Api.csproj" />
</ItemGroup>
Add "vscode-solution-explorer" Extension. It will folder structure as visual studio. Right click on project --> Add Reference --> Select the reference project from the list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With