我是靠谱客的博主 简单老鼠,这篇文章主要介绍vs code + .net core添加程序集,现在分享给大家,希望可以做个参考。

添加项目引用

cd MyProject.Test
dotnet add reference …/MyProject/MyProject.csproj

或者csproj中添加

复制代码
1
2
3
4
<ItemGroup> <ProjectReference Include="..AwesomeLibrary.CoreAwesomeLibrary.Core.csproj" /> </ItemGroup>

csproj中直接添加依赖项

复制代码
1
2
3
4
<ItemGroup> <PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> </ItemGroup>

通过nuget添加引用
1点击ide上extension,输入nuget,安装NuGet Package Manager
2键入ctrl+shift+p,输入nuget,选择 NuGet Package Manager add package
在这里插入图片描述输入需安装的包以json为例
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

添加本地程序集

复制代码
1
2
3
4
5
6
7
<ItemGroup> <Reference Include="log4net"> <HintPath>..dlllog4net.dll</HintPath> </Reference> </ItemGroup>

执行完上述步骤可使用dotnet build重载相关引用

最后

以上就是简单老鼠最近收集整理的关于vs code + .net core添加程序集的全部内容,更多相关vs内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(82)

评论列表共有 0 条评论

立即
投稿
返回
顶部