0

I have a project with few dlls. I would like to change one of them to framework 4.0, but not the other ones. The result will be that a framework 2.0 dll is using a framework 4.0 dll. Is that ok, or problematic?

Thanks.

2
  • Why would you want to do something like this? If you're thinking of avoiding installing .net4 then you'll have so much trouble deploying your extra dll. Commented Jun 18, 2012 at 6:18
  • The problem is that other projects on the same server, sometimes use my dll. The one i want to change to framework 4.0. I can't force them all to upgrade the framework. Commented Jun 18, 2012 at 6:21

1 Answer 1

4

No - a project which targets .NET 2 can't refer to a library targeting .NET 4. Imagine you tried to deploy it on a machine which only supported .NET 2 - you couldn't actually use your .NET 2 assembly anyway, so what's the point of making it target .NET 2 in the first place?

It makes sense to target a .NET 2 library from a .NET 4 project, but not the other way round.

Sign up to request clarification or add additional context in comments.

2 Comments

What if the machine supports both 2.0 and 4.0, will it work? For the question why, please look at the answer I gave Gideon. Thank you for your time.
@Itay.B: The point is that it won't build, precisely because it's not useful. If you can only use your library on machines with .NET 4 (which is the case because of the reference to a .NET 4 library) then you should make it target .NET 4.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.