I am a beginner in silverlight and want to know about the silverlight flow when running in a browser:

I've download an application from web that combine with silverlight + wcf, and want this wcf to run in my silverlight application. I've copied the wcf project called fileupanddownlod.web into my silverlight solution. so now I have these projects: silverlightapplication1 (silverlight, contains the service reference fileupanddownload) fileupanddownload.web (WCF)

I've tried to run the silverlight as startpproject - so it runs a path of

...\Bin\Release\SilverlightApplication1TestPage.html 

but when I called the wcf in cause communication exception. so I saw in the project I've download that they run the wcf - fileupanddownload.web as startupproject so then it runs the path:

this seems more correct....

BUT... when I run the silverlight as strtup project I can see in the browser the xaml I want to run, and when setting the fileupanddownload.web as startup project I can only see the xaml that was in the project I've download, but I don't know from where it takes it...

can someone let me know: where can I see the code of the connection that silverlight does in order to run a xaml from the aspx file? I can see only that the source is :

 <param name="source" value="ClientBin/FileUpAndDownload.xap"/>

is it here I have to change? and if yes - how can I generate a xap (and what is it xap)

thanks a lot!

Accepted Answer

Xap is the extension for Silverlight applications, i.e. the last thing the Silverlight build rules produce.

When hosting silverlight applications in web projects, you need to configure the web project to properly reference them:

  • right-click on the web project and click Properties
  • go to the Silverlight Applications tab enter image description here
  • click Add...
  • select the existing silverlight project from the combo boxenter image description here

  • click Add

You'll now be able to run the your latest silverlight build from the web project.

Written by Stefan Dragnev
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki