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
I finally found a way to reference any .net assembly within visual studio code.
First to note: I only need the vscode for the intellisense. I will not compile the assembly in vscode /.netcore. When I'm done with coding, I will use commandline-tools to generate my assembly.
And this is my solution:
Create an regular .net class library with Visual studio (not code) This will create an myproject.csproj-file (wich can be read by vscode). Or use my test.csproj-file at the bottom of the post.
create an folder for the referenced assemblies. I've just created an libs-directory inside the top-directory.
close vs and open the folder with vscode.
modify the *.csproj-file as followed:
note: we've created the project in debug-mode, so we can remove the release-property-group:
4.2. remove the Release-PropertyGroup (you don't have to, but you don't need it)
pdbonly
true
bin\Release\
TRACE
prompt
4
4.3. Modify the bin-output-path to the libs-directory
from
bin\Debug\
to
libs
4.4. put your referencing .net assembly (external or custom) in the libs-directory and references them like:
...
False
log4net.dll
...
...
this is the complete *.csproj file with reference to an log4net.dll.
Debug
AnyCPU
{75278D05-4850-4282-8AB4-3643A9E799FF}
Library
Properties
Test
Test
v4.6
512
true
full
false
libs
DEBUG;TRACE
prompt
4
False
log4net.dll