Full and client fallback

Apr 23, 2011 at 2:49 AM

Hi

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?

Coordinator
Apr 23, 2011 at 2: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 4: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?

Developer
Apr 23, 2011 at 4:45 AM
Edited May 10, 2011 at 10: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 5:06 AM
Edited Apr 23, 2011 at 5: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.