Silverlight Business Application - ASP.Net MVC - silverlight

My first question is, what is the difference between a normal Silverlight Application in Visual Studio VS. a Silverlight Business Application?!
My second question is, when I begin a new Silverlight Application Visual Studio asks whether I want to use an ASP.Net website to host the project, or an ASP.Net MVC project. HOWEVER, When I create a new Silverlight BUSINESS Application, Visual Studio does not let me specify which type of ASP.Net website I want to hose my application in and simply creates a normal ASP.Net project by default. Since I want to use ASP.Net MVC, is there a way of changing this so that I can use an MVC project by default? Or somewhere to specify which one I want to use!?
Kind regards.

Silverlight Business Application is a new template project made available through the .NET RIA Services framework.
I guess there is no out-of-the-box support for ASP.NET MVC since the .NET RIA Services only exists as a preview (which was released in july). This thread answers your questions, and it seems they are working on ASP.NET MVC support.
PS. I propose that you re-tag your question with [ria-services].

Related

To what extent is a possible to write a web application with WPF and are there any advantages of doing so over using ASP.NET / MVC?

I know that it's possible to use WPF for web development but are there any circumstances in which it would be better to use WPF? Or is it more common practice to ASP.NET Forms/MVC?
I know that it's possible to use WPF for web development
Wrong. WPF is part of the .Net Framework. It is a Windows Client technology that requires the target computer to have the .Net Framework installed in order to run.
Web applications consist of a Web Server delivering Web Content (HTML [+Javascript+CSS]) to a Web Client (Browser).
WPF has nothing to do with that. It does not produce HTML or any other Web content and it is not a Server Side technology.
Bottom line:
Use Web technologies (A server side technology that outputs HTML (such as ASP.Net MVC)) if you need to create a Web Application.
Use WPF if you need to create a rich, highly interactive Windows Desktop application.
Use WinRT XAML (similar to WPF) if you need to create a rich, highly interactive Windows "Metro Style" application.
In addition to what #HighCore said, it's possible to use technology similar to WPF in a web environment. For example, Silverlight uses XAML markup. It's kind of similar to a Java applet if you're familiar with those. Silverlight is particularly handy for doing something that requires a lot of graphics or media in the browser, but it's not as full featured as WPF. In addition, you have to hope that the user has a Silverlight plugin which isn't available on all platforms. For example, Linux and mobile have limited or no Silverlight capability.
You could develop a WPF application and deliver it as a ClickOnce application. You're pretty much limited to Windows targets.
If you're trying to develop a website, then stick to ASP.NET Web Forms or MVC or some other server side technology that serves HTML to browsers, as HighCore said.

Sharing SQL CE 4.0 db and Entity Framework 4.0 between web project and winforms project

I have a web based application developed using MVC 3, Entity Framework 4.0 and SQL CE 4.0. It is used for showing off analysis results and data in charts on a web site. There is little to no data additions from web users in any way.
My second project is part of the same solution and is a basic Win Forms application in C#. Its main purpose is to analyse raw data and update the database for the web site. When I am happy with the system I am likely to automate this part.
I wanted to have a process where I ran the Win Forms based tools to update the database, then deployed the web project to the server, effectively updating the DB on the server.
The problem begins with referencing the Entity Framework objects in the Web App from the Win Forms project. The SQL CE db and Code First implementation of EF 4.0 resides inside the web project. I reference that project from the Win Forms project and for a short time I can use it for development. When I try to build the project and use the Win Forms app the reference goes away and everything fails. I have no idea why this is happening.
Any insight would be helpful.
Doug

Exchanging data between MVC 2 asp.net 3.5 and Silverlight 4

I wrote an application using RIA services in a .net 4.0 project that used domain services to communicate with a client-side Silverlight 4 application. By the way this is my first data driven Silverlight.
I just found out that I will need to make it run in a MVC2 project running .net 3.5 on the server.
Is it possible to make RIA services work in 3.5?
If not, what would be the best way to recreate the project in 3.5?
Unfortunately this scenario is not going to work. Your choices are either host the server on .NET 4.0 or backport with .NET 3.5, SL3 and Beta2 of RIA Services.

LightSwitch vs WinForms

What is the difference between Visual Studio LightSwitch and WinForms?
Why we should choose one over the other?
Update: I understand that LightSwitch is an application framework. May be the better question is, how a LighSwitch application compares to a windows forms application built with Composite Application Block (CAB)
Lightswitch is a template driven application development environment for Visual Studio. It creates Silverlight applications that use a View-Model architecture, using Entity Framework and RIA services for data access.
The applications can be run locally on the desktop with a local data store, or with a data store on a server, or run in a browser with a data store on a server.
The Lightswitch framework includes designers to create and manage most aspects of an business application such as:
Data model with validation and relationships
Screens
Menus
Queries
As of Beta 1, there is no built-in reporting engine
It's scope remains to be seen, but I believe it's targeted for development of corporate in-house applications, such as CMS systems, billing systems, etc. and also line-of-business applications, small and large scale.
WinForms or Windows Forms is the graphical API for .NET that lets you create user interfaces with forms and controls, etc. It's not a complete application development framework.
This thread compares LightSwitch to building line-of-business applications in Silverlight today:
http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/3f6161b6-33a3-4b6a-a4d8-ea693d6ba273
This video gives a high-level overview of LightSwitch
http://www.microsoft.com/showcase/en/us/details/74ed35cb-709b-46f7-8b21-2f681965ed0b
Sorry Carlos, but LightSwitch does not generate either WinForms, or WebForms projects. The only official client technology is a Silverlight client, whether it is a web application, or a desktop (OOB) application.
In the very early days, I believe the client was originally WPF, but that was changed to SilverLight some time ago.
While LS does "generate" code, it does so for its own use, not for consumption external to LS.
One imortant distinction between Lightswitch and Composite Application Block UI, is that CAB has been retired and is no longer developed.
Reference: http://msdn.microsoft.com/en-us/library/aa480450.aspx

ASP.NET MVC vs Silverlight for an internal application

I'm in the early planning stages of an internal application and I'm considering ASP.NET MVC and Silverlight 4 as my possible platforms.
The Environment
We're a Microsoft shop and we're in the process of migrating desktops to Win7 (from XP) and servers to W2k8, I'll be able to get Silverlight 4 installed as part of our baseline Win7 build
The Application
Provide a dashboard to monitor system status
Monitoring third party connections
Monitoring database tables for particular events
Monitoring SQL Server Log Shipping
...
Provide portal like access to system tasks to end users
Bulk updates to databse rows
Running SSRS Reports
Re-running automated tasks that have failed
...
The Team
We're a small team of 2 and neither of us have production exeprience in Silverlight or ASP.NET MVC so we'll be learning whichever we go for.
What would you pick and why?
The answer really depends on your experience. If you are an experienced web developer and have a lot of practice with ASP.NET then use that for sure. If your background is WPF and WinForms then use Silverlight.
My experience is that the ramp up time to use Silverlight for an ASP.NET developer is significantly longer than it is for a straight .NET application developer. The ASP.NET developer has to unlearn a great deal before they begin because the development paradigm for Silverlight is more akin to app development.
The other alternative is to use both. ASP.NET for the navigation, authentication, general layout and Silverlight for the data realisation (graphs etc).
I would pick ASP.NET MVC. I have experience in both Silverlight and ASP.NET MVC and Silverlight undoubtedly has a steeper learning curve. While it will definitely enable you to develop rich user interfaces (it enables amazing composition) it may be overkill for an internal application.
ASP.NET MVC on the other hand will enable you to do what you are aiming to achieve but I believe (due to the learning curve) you'll be able to do so MUCH more quickly. It is also much easier in my experience to enable dependency injection and write unit tests for ASP.NET MVC than it is for silverlight which may or may not be a consideration..
Silverlight. I think ASP.NET MVC more for public websites, whereas internal applications - Webforms or Silverlight in your case.
Silverlight - Desktop > Web for applications (not for simple data presentations though) whenever possible. The bad news is that desktop is not always possible. The good news is that it is possible for you. You can even use the out of browser features which is even cooler.
Use Silverlight with the MVVM pattern.

Resources