0

In case most projects inside a WPF app solution target .NET Framework 4, can some class library projects of the same solution target .NET Framework 4 Client Profile?
Is it totally okay, or could there be something wrong with such a combination?

Kendall Frey
  • 43,130
  • 20
  • 110
  • 148
rem
  • 16,745
  • 37
  • 112
  • 180

4 Answers4

4

Yes, this is totally OK. Client Profile is a strict subset of the full framework, so the application as a whole will work fine.

The application will require that the full .NET 4.0 be installed, but the class libraries that target the CP themselves can be reused (e.g. as part of another application that also targets the CP).

Jon
  • 428,835
  • 81
  • 738
  • 806
3

It's ok but i think you missing the idea of .NET Framework 4 Client Profile.

The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. It provides functionality for most client applications, including Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and ClickOnce features. This enables faster deployment and a smaller install package for applications that target the .NET Framework 4 Client Profile.

your apllication will need to run on computer with full .NET4 environment although you target some projects with .NET Framework 4 Client Profile.

Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
  • Why? Assuming a project in the solution *needs* the full FW and another project does not, isn't it logical to make the latter target the CP instead of the full FW? *Especially* if it's a reusable DLL? – Jon Apr 18 '12 at 14:26
  • @Jon thanks for your comment, it's logical and true for future use but I want to make sure he understand the idea of .NET Framework 4 Client Profile – Dor Cohen Apr 18 '12 at 14:28
  • @Jon If it works on .NET Framework 4 and Client Profile, then I think it is obvious to target the superset (not the subset). And then no need to install Client Profile. I m just curious to know..it isn't my final statement. – Marshal Apr 18 '12 at 14:31
  • @Marshal: Uh... why do you think that, let alone why it's *obvious* as well? If you install the full FW, you also have the CP. – Jon Apr 18 '12 at 14:35
  • @Jon: Ok I agree that we have the CP with it. But then will it make performance difference if we target either CP or Full (to the projects which requires only CP). – Marshal Apr 18 '12 at 14:37
  • @Marshal: If that is a question: no. If it's an assertion: I disagree, please provide some sources. In any case, you will most likely find the documentation better suited to increasing your knowledge than my comments. – Jon Apr 18 '12 at 14:42
3

It should be fine, unless one of the Client Profile projects references one of the full Framework projects. Then it is somewhat pointless to target CP, since the full Framework is required. I don't think you will have problems with mixing them, but if the projects are related it might be a good idea to set them all to the full .NET.

Kendall Frey
  • 43,130
  • 20
  • 110
  • 148
2

The only problem I can see is that if you have one or more projects in your solution that are using the .NET Framework 4 target and not the Client Profile is that it will force your whole solution to require the full .NET Framework. Other than that it shouldn't make much of a difference and you can easily change all the projects to use the full .NET Framework, or the other way around if you do not need all the .NET functionality for your solution.

The bottom line is that it will work fine, but if one or more of the projects are using the full .NET Framework 4 it may require your clients to install additional updates, depending on your requirements.

A good introduction to the concept as well as a list of what’s in and what’s not for the Client Profile available here: http://blogs.msdn.com/b/jgoldb/archive/2009/05/27/net-framework-4-client-profile-introduction.aspx

eandersson
  • 25,781
  • 8
  • 89
  • 110