Use .Net 4.0 UserControl in .Net 2.0
Asked Answered
R

2

0

I created a UserControl in .Net 4.0 App, and now I need that UserControl in another App which is in .Net 2.0 environment. Is it possible to use my UserControl in the .Net 2.0 App (VS 2005)?

Rucksack answered 26/4, 2012 at 11:33 Comment(0)
O
12

enter image description here

One does not simply use .NET 4 in an older environment.

Oceangoing answered 26/4, 2012 at 11:37 Comment(7)
Thx for your answer, and I love that emotion LOLRucksack
Indeed, my pleasure. Atleast it is very clear what the answer is. :P But like @kaze said. If you don't use any features above .net2 you should recompile with .net 2.0 as the target platform.Oceangoing
I'm using .net4 features, what i can think of is using web service to expose the various methods that i have in my user control. Sigh.Rucksack
That might be an option, and else you might need to rewrite your control in .NET 2. And of course you might want to upgrade that environment to .NET 4. If that is not possible... I would just rage against my boss and convince him to switch over. :POceangoing
the .Net 2 app is the core app that has been around for some time and grown into a size that we just don't have enough resources to upgrade at the moment. I don't really need the UserControl, what I need is the object and logic within it. I see no other option except relay them thru web service as for now :'( cryRucksack
And it just isn't possible to rewrite some of the .NET4 features into .NET2 features?Oceangoing
Not quite possible as it seems. Sad.Rucksack
A
1

No, but the other way around works, .net2 -> .net4

If you're not using any features above .net2, you could recompile with net2.0 as target platform.

Acceptable answered 26/4, 2012 at 11:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.