Sunday 20 May 2012

silverlight-out-of-browser-settings


Silverlight: Out-of-Browser Settings (with error resolving)




This article will give you basic idea about “Out-Of-Browser” settings under Silverlight:
Just want to give some information regarding these settings.


These are the Softwares/Tools I'm using:
  •  MicrosoftVisualStudio 2010
  •  .net framework 4.0
  •  Silverlight 4.0

Basically, we run our Silverlight project under default settings i.e. application running on our browser with link as http://localhost:3906/..........
If we want to run an application outside the browser then we can follow these steps:

  • Considering name of the project as “SilverlightOutOfBrowserAppAMTDW” and just showing one label and one image under application for simplicity.
          Solution Explorer -> SilverlightOutOfBrowserAppAMTDW 
                                        -> right click
                                        -> Properties

 
Silverlight - techterabyte.com


                     This window will open after following the above steps:


Silverlight - techterabyte.com
Out of Browser Settings



  •       Enable the settings:

Silverlight - techterabyte.com



  •       Now click on the button “Out-of-Browser Settings …” :
                Below window will open now:

Silverlight - techterabyte.com
OUT-OF-BROWSER SETTINGS

  •       CheckBox:“Require elevated trust when running outside the browser

Silverlight - techterabyte.com
Enabling Settings


  •   Now after running, your Silverlight Application will look like this:
Silverlight - techterabyte.com
OUTPUT

 

But if you want to view your application under browser again, then you may face some problem, the same is discussed below (with it's solution).

 

If you undo the changes done before then your application will run under browser but the address bar will show the following ( not localhost):

C:\Documents and Settings\amt.dw\My Documents\Visual Studio2010\Projects\SilverlightOutOfBrowserAppAMTDW………………




Error under above:
While working on Silverlight application you may get into some problem.
I went through the same condition and resolved it after trying different ways (at the end succeeded in solving)
This article will give you a general idea about the error which may occur if you want to go to the same situation which you were in the initial stage.
If you want the above application to run again as under browser then even after undoing the changes, you may not get the desired result. 
The project will run under browser but will run like this:

C:\Documents and Settings\amt.dw\My Documents\Visual Studio2010\Projects\SilverlightOutOfBrowserAppAMTDW……


For running under browser (i.e.….as http://localhost:3906/.........can be viewed under browser address) follow the following step:
->  Solution Explorer
->  SilverlightOutOfBrowserAppAMTDW.web 
->  RightClick
->  Set AsStartup project.

Now save and run your application.



__________________________________________________________________________
Please comment and forward to others if you like this.
Other posts with video tutorial yet to come.....

"I am sure that blogs really help people around the world.
Let us follow this simple thinking of sharing knowledge . . ."







2 comments:

  1. Im able to run at Windows mode but not in browser.
    After setting the following steps-
    -> Solution Explorer
    -> SilverlightOutOfBrowserAppAMTDW.web
    -> RightClick
    -> Set AsStartup project.
    I am not able to get the result in browser. Kindly please help!!

    ReplyDelete
  2. just restart your project and try again...

    ReplyDelete