Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference project in two ways

I have a project that is called framework and I have modules projects which depends on this framework project.

The problem is: Some developers on my team will have this framework code and others won't. I want to know if there is a way that if Visual Studio doesn't find this reference, it will automatically get this frameworks libs from nuget package.

like image 314
carlosza Avatar asked Oct 17 '25 15:10

carlosza


1 Answers

You could use Conditions to include the project only if it does exist:

<ProjectReference Include="..\..\Framework\Framework.csproj" Condition="Exists('..\..\Framework\Framework.csproj')" />

<PackageReference Include="MyCompany.Framework" Version="1.0.0" Condition="!Exists('..\..\Framework\Framework.csproj')" />
like image 127
Gene Avatar answered Oct 19 '25 06:10

Gene