views:

56

answers:

2

Is it possible to change the target framework to .net 4.0 in an application originally started in Silverlight 3? I have upgraded the Silverlight target to Silverlight 4 with no problem, but it seems that I am stuck with using the .net framework 3.5 in my actual C# code. (I'm trying to use threading tasks if that is any help)

I am using the most up to date version of Visual Studio 2010. I can't seem to find an explicit way to set the framework of the Silverlight (the target framework for the companion website is easy to find)

Thanks everyone.

A: 

If you right click on the SilverLight project - > click properties -> select the "SilverLight Tab" is there not a combobox for "Target Silver version"?

Ben
There is - for some reason I can't use the .net framework v 4.0 in my project. Visual Studio won't let me upgrade to it.
Steve French
+1  A: 

Silverlight integration in VS2010 isn't that smooth yet. The build tools are still in beta. The ".NET Framework Target" setting has no effect and they forgot to disable it. Silverlight runs on its own CLR version. You normally get prompted for the Silverlight runtime version when you create a new project. You can change it afterward with Project + Properties, Silverlight tab, "Target Silverlight Version" combobox.

You won't find 4.0 in this combobox if you didn't install it yet. That's done separate, after you install VS2010. Download location is here.

Hans Passant
Actually I've done that, and still no luck.
Steve French
Describe your problem better. What do you see when you start a new project? What do you see when you use Project + Properties.
Hans Passant
I can set the target Silverlight version to 4.0, however, I am stuck using version 2 of mscorlib and there seems to be no way to upgrade it to the more recent version.. I'm trying to use the new task features of the .net framework 4.0.
Steve French
Repeating: Silverlight uses its own version of the CLR and the .NET libraries. It is quite distinct from the desktop version of .NET 4.0. Not just because it needs to run inside a browser but also because the download needs to be small. The Task class is not available.
Hans Passant
Aha. I did not realize there was that exclusion. Thank you for your help.
Steve French
Do you have a reference to SL4 build tools still being in beta? I thought all of SL4 was RTW since April?
itchi