Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:08:21+00:00 2026-06-15T18:08:21+00:00

I am building a NuGet package that references the Microsoft CommonServiceLocator assembly. There are

  • 0

I am building a NuGet package that references the Microsoft CommonServiceLocator assembly.

There are two versions of the Microsoft CommonServiceLocator out there:

  • CommonServiceLocator – targets the full .NET framework and is referenced by the Microsoft EnterpriseLibrary components.
  • Portable.CommonServiceLocator – contains both the full version of CommonServiceLocator and the recently released Portable Class Library version.

My project is a Portable Class Library but, because it’s sometimes used with Enterprise Library, I need to sort of “conditionally” reference the portable version so there’s no conflict.

  • If the target framework is full .NET 4.0/4.5, use the original CommonServiceLocator package so people can also use the Enterprise Library bits (which also reference the CommonServiceLocator package).
  • If the target framework is portable (or anything else) use the Portable.CommonServiceLocator package.

I see the new “group” feature in the NuGet docs showing how to specify dependencies in your .nuspec file and I think that will do what I want, but I’m not sure how to test it.

Here’s what I think I need to do and I’m hoping someone can validate my approach or point me in the right direction:

<dependencies>
  <group>
    <!-- Always include regardless of target framework -->
    <dependency id="Autofac" />
  </group>
  <group targetFramework="net40">
    <!-- Also include the full CSL if it's full framework -->
    <dependency id="CommonServiceLocator" />
  </group>
  <group targetFramework="portable-win+sl50+wp8">
    <!-- Otherwise include the Portable CSL -->
    <dependency id="Portable.CommonServiceLocator" />
  </group>
</dependencies>

Specifically…

  • Is my targetFramework syntax right? I can’t find any examples, so I don’t know if the + delimited mechanism is right or if it should be comma-delimited.
  • Will the default group work? That group with the unspecified target framework – will that always be included or do I need to copy/paste it in every group?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:08:22+00:00Added an answer on June 15, 2026 at 6:08 pm

    Yeah, that’s pretty much correct. Details on portable framework names can be found here http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Framework_Names

    One more thing I found, since win+sl50+wp8 by default includes net45 you might want to include it so that this dependency group gets installed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When building a multi-framework package for Nuget you need to divide up the library
I'm building a nuget package for my company MVC4 template. I have run into
I'm building a NuGet package in a build step in Jenkins (although Jenkins is
building a site using PHP and MySQL that needs to store a lot of
Building a website that has English & Japanese speaking users, with the Japanese users
Building a new ASP.net application, and planning to separate DB, 'service' tier and Web/UI
Building an iPhone OS application that will allow users to anonymously post information to
I'm building an application using ASP.net MVC 3 and I'm wondering if anyone knows
Building my first WP theme and I quickly realized that I need to remove
Building a rails B2B application that will have various users. I'm pretty clear on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.