I have a DLL (not a NuGet package) I want to reference in a C# program, in Visual Studio Code (not Visual Studio) V1.52.1. I cannot seem to add the reference.
The DLL is named Plumage.dll. The source code line looks like this:
Plumage.TSDRReq t = new Plumage.TSDRReq();
That generates the error "The type or namespace name 'Plumage' could not be found (are you missing a using directive or an assembly reference?) [testplum]csharp(CS0246)"
Adding
Using Plumage;
does not help and generates the same error message for that line.
I have tried copying the dll to: the same directory as my source; to the subdirectories obj\Debug\net5.0
and obj\Debug\net5.0\ref
; and to the subdirectories bin\Debug\net5.0
and bin\Debug\net5.0\ref
.
I have tried adding different variations of the following to my .csproj file:
<ItemGroup>
<Reference Include="Plumage.dll">
<HintPath>Plumage.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
I am running dotnet restore
(and/or dotnet restore force
) after changes. Still no progress.
I've read and tried the approaches here (but that's to add a project, not a dll) and here .
I'm finding a lot of information on how to add a NuGet package (but this is not a NuGet package); and a lot of information adding a reference using Visual Studio (but this is Visual Studio Code); but I'm still stuck.