Solved

How to deploy silverlight application?

Posted on 2010-08-21
8
1,014 Views
Last Modified: 2013-11-12
Hi,

I created a small  silverlight application with  button and text . I want to deploy this  application in IIS.
How can I do that. Can you please let me  know step by step.
0
Comment
Question by:N_Sri
  • 3
  • 3
  • 2
8 Comments
 
LVL 27

Accepted Solution

by:
nmarun earned 334 total points
ID: 33493781
Sri, Use Visual Studio's publish feature. Right-click on your project and choose Publish... point the publish folder to a local folder, say 'c:\temp\mySlApp'. Once the process is complete, all you need to do is to copy the entire folder structure (inside the 'mySlApp' folder) to your hosting server.Unless there's something weird on your hosting server, you should be able to get your SL app working.Arun
0
 
LVL 16

Assisted Solution

by:Vikram Singh Saini
Vikram Singh Saini earned 166 total points
ID: 33493900
Hi,

I am assuming that you are creating your Silverlight application using Visual studio 2010 and Silverlight 3.0. And you are having OS Windows XP SP2 and IIS 5.1.

But one thing I came to know about the deployment of the Silverlight Application on IIS is that you need to register some of the MIME types with IIS. By default IIS 7.0 have that mime support default. However for registering MIME types with IIS 5.1 and 6.0 you can check link:
http://techencoder.com/index.php/2009/05/deploying-silverlight-2-on-iis/

I learned Silverlight and created application after reading your problem statement. I used two buttons named Submit and Reset. One TextBox for accepting user name and label to show that name.
Steps for Deployment of Silverlight App on IIS 5.1:

(1) Start --> Control Panel --> Internet Information Services.

(2) In IIS window, Default Web Site --> Right Click --> New --> Virtual Directory. (I am assuming that you are aware of creating virtual directory on IIS, if not please let me know back).

(3) You would need to set DefaultDocument for your website by selecting your alias or virtual directory you created earlier in step2 and then right click --> Properties --> Tab Documents -->And here set your default page (In my case it was http://localhost/Silverlight/) -->OK.

(4) Now open your web browser. I used both Internet Explorer and Mozilla Firefox 3.5. And type as http://localhost/Silverlight/ where Silverlight is the name of the virtual directory created by you in the step 2.

Now you would see the default page set by you.

Regards,
V.S.Saini


-------------------------
// Mainpage.xaml
-------------------------
<UserControl x:Class="MyFirstSL.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input">

    <Grid x:Name="LayoutRoot" Height="199" Width="328" Background="WhiteSmoke" Margin="1" UseLayoutRounding="True" ShowGridLines="False">
        <Button Content="Submit" Height="23" HorizontalAlignment="Left" Margin="144,135,0,0" Name="btnSubmit" VerticalAlignment="Top" Width="75" Click="btnSubmit_Click" />
        <dataInput:Label Height="23" HorizontalAlignment="Left" Margin="12,86,0,0" Name="label1" VerticalAlignment="Top" Width="100" Content="Enter your Name:" />
        <dataInput:Label Height="22" HorizontalAlignment="Left" Margin="102,12,0,0" Name="label2" VerticalAlignment="Top" Width="151" Content="MY FIRST SL APPS." FontFamily="Trebuchet MS" FontSize="13" Foreground="DarkOrange" FontWeight="ExtraBold"></dataInput:Label>
        <dataInput:Label Content="Status:" Height="23" HorizontalAlignment="Left" Margin="12,164,0,0" Name="lblStatus" VerticalAlignment="Top" Width="304" Foreground="Blue"></dataInput:Label>
        <TextBox Height="23" HorizontalAlignment="Left" Margin="120,86,0,0" Name="txtName" VerticalAlignment="Top" Width="188" Foreground="Navy" />
        <Image Height="58" HorizontalAlignment="Left" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="79" Source="/MyFirstSL;component/Images/logo_SilverLight1.JPG" Margin="12,12,0,0" />
        <Button Content="Reset" Height="23" HorizontalAlignment="Left" Margin="233,135,0,0" Name="btnReset" VerticalAlignment="Top" Width="75" Click="btnReset_Click" />
    </Grid>
</UserControl>

-------------------------------
// Mainpage.xaml.cs
-------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MyFirstSL
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            lblStatus.Content = "Your Name: "+this.txtName.Text;
        }

        private void btnReset_Click(object sender, RoutedEventArgs e)
        {
            this.txtName.Text = String.Empty;
            lblStatus.Content = "Status:";
        }        
    }
}

Open in new window

SA.bmp
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 33493918
Hi,

Sorry I mentioned wrong OS Windows XP SP2 but it is SP#. Because VS 2010 needs SP3 minimum for installing.

 However deployment steps discussed above can be tried with any application created with any tool.

Regards,
V.S.Saini
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 27

Expert Comment

by:nmarun
ID: 33556249
You need any other help on this?

Arun
0
 

Author Comment

by:N_Sri
ID: 33599594
Can you please help how to deploy in IIS 7 WebServer
0
 

Author Comment

by:N_Sri
ID: 33599701
Please let me know the steps how to publish and and how to deploy it.

0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 33601781
Follow the steps mentioned above. I think they would work successfully in case of deployment too. And in IIS 7.0 you would not need to register mime types. They are already there (based on reading online).

Let us know the result back.
0
 
LVL 27

Assisted Solution

by:nmarun
nmarun earned 334 total points
ID: 33606637
What happens when you do as I posted?

Arun
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question