添加项目引用
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内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复