VSCode C#添加对自定义程序集的引用 [英] VSCode c# add reference to custom assembly

查看:719
本文介绍了VSCode C#添加对自定义程序集的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio Code中,我只想添加一个引用到

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

"../libs/mylib.dll"

"../libs/mylib.dll"

如何添加此依赖项?

我试图将路径添加到依赖项,但由于其错误而无法编译:)

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

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

"dependencies": {
    "log4net" : { "assembly":"../libs/log4net.dll" }
  },

推荐答案

简单,只需添加以下内容:

simpler, just add the following:

1)修改myproject.csproj文件

1) modify the myproject.csproj file

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

2)添加要使用的库的 using .示例:使用Dllcomun;

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

这篇关于VSCode C#添加对自定义程序集的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆