visual studio - NuGet Automatic Package Restore when using git submodules -
i trying understand if there way rely on nuget automatic package restore when referencing libraries hosted on github. problem when add library submodule, has it's own /packages/ directory. but, when add csproj library solution since there no dlls in /packages/ directory of submodule, build fails.
obviously, easy fix on machine open .sln file submodule i've referenced, build. now, building main solution work since /packages/ folder in submodule populated. but, not can on build server.
any way of solving problem without messing submodule? don't want change submodule .csproj because put out of sync origin. ideally love if instruct nuget pull packages referenced submodule .csproj in it's own /packages/ directory.
there 2 types of automatic package restore. 1 triggered when build solution within visual studio, , 1 msbuild based , requires modifying project run nuget.exe restore part of build. msbuild based restore enabled selecting enable nuget package restore, has been deprecated nuget team.
for build server need either:
- run
nuget.exe restore
solutions before run build. - have nuget packages restored msbuild main solution built.
to restore nuget packages msbuild can use deprecated msbuild based nuget package restore or perhaps better create before.yoursolution.sln.targets file described in ultimate cross platform nuget restore post. custom before....targets file need restore packages submodule.
if use msbuild based restore 1 of benefits there no pre-build step needs run before building solution since building solution restore. 1 of problems of msbuild based package restore, @ least 1 enabled when selecting enable nuget package restore in visual studio, can cause problems nuget packages use own custom msbuild .targets files.
Comments
Post a Comment