-
Feb 6th, 2022, 09:08 AM
#1
Visual Studio: Add project references for .NET Core
Microsoft documentation for adding a project reference in the same Visual Studio solution is to right click on the project in Solution Explorer, select Add, References, Add project reference.
Important
This only works for .NET Core projects.
Naysayers
For this tip, there will be naysayers so I will head this off by saying, sure this tip can be a problem for those with fumble fingers.
Scenario
You have one or two classes projects and a main project which requires project references to the two class projects.
In Solution Explorer, select the two class projects by holding down the control key and single click each class project. Next, drag those selected project to the main project node in Solution Explorer.
Double click, in this case on MainApp to open the project file, there are now two references.
Code:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<LangVersion>9.0</LangVersion>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BasicsEntityCoreCodeSample\DeconstructCodeSamples.csproj" />
<ProjectReference Include="..\WindowsFormsLibrary\WindowsFormsLibrary.csproj" />
</ItemGroup>
</Project>
Related
And on a related note, a developer may add a local resource for a project by opening the resource tab, initialize followed by dragging a file on to the Resources tab, done.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|