Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode c# add reference to custom assembly

in Visual Studio Code I simply want to add a reference to an custom c# assembly like

"../libs/mylib.dll"

how can I add this dependency?

I tried to add the path to the dependency but was not able to compile because its just wrong :)

"dependencies": {
    "myassembly" : "../libs/Common.dll"
  },

or

"dependencies": {
    "log4net" : { "assembly":"../libs/log4net.dll" }
  },
like image 662
Tobias Koller Avatar asked Dec 29 '16 13:12

Tobias Koller


People also ask

Does Vscode support C?

C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.

Can you do C in Visual Studio?

The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.


1 Answers

simpler, just add the following:

1) modify the myproject.csproj file

    <ItemGroup>
     <Reference Include="DllComunVb2008">
       <HintPath>..\Dlls\DllComunVb2008.dll</HintPath>
     </Reference>
    </ItemGroup>

2) Add the using of the library you are going to use. Example: using Dllcomun;

like image 192
Alberto T. Payero Avatar answered Oct 25 '22 23:10

Alberto T. Payero