Add reference to same Nuget package but for different targets -


i have solution in visual studio 2013 more c# project files have source code in common targeting different platforms (.net, winrt, .net micro framework , on). csproj files under same directory.

these projects use nuget package available above platforms itself.

if add nuget package 1 of project (ex. .net), package.config file created , inside has reference target (ex. .net). package downloaded in packages folder.

if try add same package different target project in solution, ui tells me package installed. it's true because package.config file there i'd have same package different target.

so question following : how can add same nuget package different projects different targets ?

thanks, paolo

unfortunately, don't think nuget supports scenario.

nuget expects packages.config file in same folder .csproj file. there should 1-to-1 relation between these files. should create separate folder each project rather keep .csproj files in same folder.

if want share code across multiple projects, easiest way use new shared project support in visual studio. applies universal projects, there extension[1] can install enables shared projects project types.

simply create new shared project. add common code it. in platform specific projects, can add shared project reference.

since each project independent, nuget add appropriate package.

hope helps. luck!


[1] shared project reference manager https://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -