Multiple packages.config files for same project?

Topics: General
Feb 26, 2014 at 9:33 AM
Edited Feb 26, 2014 at 9:35 AM
I'm developing plugins for ReSharper, and due to changes in each ReSharper SDK version, it requires me to maintain several versions of my project files, each targeting a different version of the SDK. This was made incredibly easy in NuGet 2.8 by allowing to specify the packages.<project_name>.config pattern, but I now have a situation where my different project versions depend on same set of "base" packages, but only the SDK packages are different, e.g.:

  depends on, say Castle.Core
  and ReSharper.SDK.8.1
  depends also on Castle.Core
  and ReSharper.SDK.8.2

all live in the same directory

I was wondering if it was possible to put the "common" packages (Castle.Core, etc) in, say, 'packages.config', and the R# SDK packages in the per-project packages.config?

Any other way this is currently possible?
Feb 26, 2014 at 9:41 AM
Sounds to me you have common code for your plugins, not only common dependencies?

If you depend on a common library that has these common dependencies, doesn't that solve your problem? (you could also create a nuget package for your common lib and have your sdk specific projects consume that one, with all its dependencies)

Just thinking out loud :)
Feb 26, 2014 at 9:45 AM
Edited Feb 26, 2014 at 9:45 AM
You're right in terms of common code - this "solution" that (most?) plugin developers use is simply cloning the csproj file, adding new references, and adding the same code files as links. It's not ideal, but it works. Most issues can be solved by either using #if SDK81 (or similar) or by using partial classes (trick I learned from @ citizenmatt).

Like I said, it's not ideal. I'd love it if "packages.config" could work like layered settings in ReSharper - global, per project (team shared), and perhaps .user (per-user, not checked into source control).