I'm developing a WebApi project on vscode with .Net Core target framework.. I have this scenario that some part of the code (db interactions and common utils) is going to be part of many other separate projects than this particular WebApi project. So I decided to code it separately in another folder as another project..
Yet I can't figure out how I am going to do this.. Whether as a project reference or an output file as dependency, doesn't matter, I couldn't figure out to use second project in the first one.. I just basically want to build a library compatible with .net core, and use it in many other .net core projects.
I need some guideline and best practice suggestions here.
UPDATE :
I think i've found a way and it seems to be working for now.
1- Adding <ProjectRefence> to FirstProject.csproj file :
<ProjectReference Include="..\SecondProject\SecondProject.csproj"></ProjectReference>
2- Add a project.json file to FirstProject and setting a dependency for SecondProject.
{
"dependencies": {
"SecondProject": {
"target": "project"
}
}
}
3- dotnet restore and build.
4- Restart vscode for proper intellisence.
UPDATE 2020
I was just too new to VS Code environment when I asked this question. I was expecting some IDE features for referencing projects to each other.