Full and client fallback

Apr 23, 2011 at 3:49 AM


My library targets the .NET 4 client framework and I have updated the nuget package to target net40-client. My library also has a .NET 2.0 version.

When user adds a reference from a .NET 4 client project everything works as expected. However, when they has a full .NET 4 project NuGet adds a reference to the .NET 2.0 dll. I would rather full .NET 4 projects used the .NET 4 client dll from the NuGet package.

To work around this issue I have duplicated the dll in the package under with net40-client and net40-full but that seems rather hacky. Is there a better way?

Apr 23, 2011 at 3:53 AM

Why not just put the dll in net40 folder. Since in both .NET 4 cases (full/client), you want to use the same dll.

Apr 23, 2011 at 5:42 AM

Because I didn't know that a client project would happily use a dll in the net40 folder.

I still find it odd that the fallback is an older framework version rather than the client version, don't you agree?

Apr 23, 2011 at 5:45 AM
Edited May 10, 2011 at 11:06 AM

Yes it does seem odd, maybe we need to bit more smarts for client profile. The algorithm thinks that net20 is more compatible than net40-client. File a bug.

Apr 23, 2011 at 6:06 AM
Edited Apr 23, 2011 at 6:07 AM

Done - http://nuget.codeplex.com/workitem/990

I've also updated my nuget package to just have net30 and net40. Personally I'd prefer it if you fixed this bug as net30-client and net40-client are more descriptive of what the dlls actually are.