Select to view content in your preferred language

Silverlight4 &  Which .Net Framework to use????

983
11
04-19-2010 12:40 PM
AngelGonzalez
Frequent Contributor
Questions to you silverlight experts.  What .Net framework should I use to develop Silverlight4 app. in?

I created  a simple helloworld SL4 app and deployed it to a server and it blew up due to the fact my app. was targeting the .Net 4.0 and the server did not have it. I changed the framework to 3.5SP1 (which is on the server and it worked).  To take advantage of the new SL4 functionality and with the upcoming ESRI SL 2.0 version do I need the .Net 4.0 Framework or can everything be done in 3.5SP1 Framework?

Note, I am a beginner in SL  and just installed VS2010 on a test machine.

Thanks

Angel
0 Kudos
11 Replies
dotMorten_esri
Esri Notable Contributor
Silverlight runs on the client, and therefore you don't need the .NET Framework at all. All you require on the client is the Silverlight 4 runtime. However, if you generate an ASP.NET based website to host your silverlight application, the server will require whatever version that website is running on. Not that you don't need ASP.NET to host this website. All you need to be able to serve out is HTML, JavaScript and the .xap file.
0 Kudos
PatrickBrooke
Emerging Contributor
I found that I was best using .net 4 with VS 2010. When I installed VS 2010, I got net 4. Many of the .dlls that my .web  portion of the project is running are compiled at .net 4. It is just easier for me. I would suggest taking a look at which .dlls you will need to reference and see which is the lowest .net you need to run. I agree with Morten, most of Silverlight's .dlls will run on anything on 2.0 or above. It depends what you need. For me it is now .net 4.
0 Kudos
dotMorten_esri
Esri Notable Contributor
most of Silverlight's .dlls will run on anything on 2.0 or above


Let me repeat: Silverlight does NOT require .NET to run. Not even version 2.0. Remember that Silverlight also runs on Mac and Linux, and there is no .NET version for these platforms.
Also: Your webserver does NOT require .NET to host Silverlight applications. ANY webserver running on ANY platform can do this.
0 Kudos
PatrickBrooke
Emerging Contributor
If you are using Mac or Linux are you not using the Java version of ArcGIS server? That is the angle I am coming from. I use .net 4 for my web project because I am using LINQ to SQL and those .dlls in my .web portion of my VS 2010 project require .net 4. i suppose I could GAC the 2.0 .dlls, but why bother. 

Are we talking semantics here? I know blog posts to translate well, I am not meaning to be a smarty pants,
I am asking real questions.

If you are using a VS.net project for SL development, don't you need to at least use .net 2.0, or am I wrong. That is how I interpreted the initial question.
0 Kudos
dotMorten_esri
Esri Notable Contributor
If you are using Mac or Linux are you not using the Java version of ArcGIS server?


Remember that Silverlight runs on the client not the server. Silverlight is just talking to a server somewhere out there in the world wide web, but everything is running inside the browser on the client operating system. The Silverlight application is simply downloaded to the client from a webserver, but it doesn't run until everything has been downloaded. This webserver could be running on anything, but that's completely irrelevent to the Silverlight client. From the webservers point of view, all it sees is a browser that requests a .xap file.

Note that when you create a new silverlight application in Visual Studio, VS will ask you if you would also like to create a website to host your silverlight application in. By default this is an ASP.NET based website, so yes for that default website you will need some version of .NET, but you could strip out all the ASP.NET stuff and just leave the .HTML, .XAP and .JS files, and you would have a server-agnostic website that could run anywhere on any type of server.

So to make a long answer to your original question short:
You do not need to worry about what .NET Framework version you are using. The only requirement you will be putting on the users of your application would be a certain minimum version of the Silverlight plugin (the default HTML file +javascript will automatically prompt the user for this if they don't have it, so you don't even have to worry about that).
0 Kudos
PatrickBrooke
Emerging Contributor
Thanks for taking the time to clarify your comments.  I do understand that Silverlight is a client app and that the asp.net page is just referencing the .xap file. Like you said, you can use  html.

So I guess the real answer to this question is Silverlight does not require .net, but if you run peripherial stuff like LINQ to SQL or any other web services type stuff, you do. But that stuff runs server side, Silverlight handels all of the clients side stuff. 

For me I will keep running on .net 4.0 😄

Thanks again for the comments.
0 Kudos
PLadd
by
Frequent Contributor
But if we are using ArcGIS Server 9.3x we must use .Net 2.0 or our map services won't publish.  So while the question doesn't necessarily deal with Silverlight in the generic sense described above, if we are developing a web site using VS 2010 and .Net 4.0 and Silverlight 4 and WCF RIA Services, how do we also include our 9.3x map services that seem to only work with .Net 2.0?

Unless I'm wrong, the answer is we wait until ArcGIS 10 is released.
0 Kudos
dotMorten_esri
Esri Notable Contributor
Again you are missing the point. What framework you have on your server has nothing to do with what Silverlight Runtime you have installed on the client. You can continue to have .NET 2.0 on your server and build ASP.NET websites for .NET 2.0.
Remember that all that Silverlight requires is a webserver that can host the .xap file. Any server can do that, including Apache on linux etc.
Just think of Silverlight as an HTML file and the runtime plugin is the "browser". The webserver just delivers a .xap file, and the runtime on the client is running and rendering it without the server knowing anything about it.

Lastly on a side note, you can have both .NET 2, 3.5 and 4 installed on your server at the same time. In IIS you can chose which version your app-pool is running on (and on another side note, .NET 3.5 really still is .NET 2.0 but with a few extra assemblies added).
0 Kudos
PLadd
by
Frequent Contributor
OK.  I get that you can run a generic Silverlight 4 app on any platform you want.  I've tried it and it works.

In my case, however, I want to take advantage of the new features in VS 2010 and Silverlight 4, including WCF RIA Services.  To do this, I'm pretty confident I need to use the .Net Framework 4.0.  But when I set IIS to use the .Net Framework 4.0, my ArcGIS 9.x map services fail.  If I try to build the Silverlight 4 site using .Net 3.5, I have to utilize the older WCF RIA Services (Beta) that worked with .Net 3.5 but will only be usable for a few more months (see quote below).

Curisously, my development machine works perfectly using VS Development Server inside VS2010.

This is from Scott Guthrie's Blog:
".NET 4, VS 2010 and Silverlight 4 have key features that we could not have done without (e.g. partial trust capability in .NET 4 and non-exception validation in Silverlight). Given that, we decided to focus on providing the best experience on the current platform and not evolve .NET 3.5/ Silverlight 3-based version further. It was a difficult choice that we arrived at after much discussion on the RIA Services forum and advice from a number of early adopters. The version shipped at PDC 2009 is still usable for a few more months if you need time to migrate."
0 Kudos