Tips & Tricks: How to change the output location of the Silverlight XAP?


In this Tips&Tricks, I will describe about changing the location of the output of your Silverlight application i.e. the .XAP file from it’s original “ClientBin” location to a different place. Developers sometimes need to put the XAP file in a specific directory based on their requirement. This trick will help them relocating the XAP file.

 

Read the full post & if you have any queries or suggestions, please let me know. Appreciate your feedbacks.

 

To change the location of the output XAP file just follow the below steps:

  • Right click on the Web Application project.
  • Click on the "Properties" from the context menu.
  • Click on "Silverlight Applications" from the left panel as shown in the below snapshot.

image

  • Click the project name from the right panel.
  • Click Remove. This step is require. Else the next step will generate a duplicate copy in both the locations while building the project.
  • Click on “Yes” in the dialog that popsup in the screen.

image

  • Click on "Add" to add a new configuration setting.
image
  • Now, you can choose the new output location for your Silverlight Application.
  • Clear the "Destination folder" textbox ("ClientBin" will be there by default). Now type your new location. It can be absolute or relative path. Here, I put relative location “MyNewClientBin”.
image
  • Click "Add" in the popup dialog box to confirm your new location of the .XAP file.
  • Click "Yes" in the dialog that popsup in the screen. This replaces the existing html page with a new one referring to the new location of the .XAP file.
image
  • Click “Yes” once again in the popup dialog box. This now ensure to replace the aspx page with a new one referring to the new location of your .XAP file.
image
  • Now build your solution. You will get the output XAP in the mentioned location.

image


  • You will see that the new Folder has been created automatically in your project directory and the new XAP is hosted inside that. In our case, it is “MyNewClientBin”. If you mentioned a absolute path, you will see the XAP created there.

So, what next? Go and put your publish anywhere you want. Don’t forget to provide your feedback.


If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter , Facebook , Google+ and LinkedIn . I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

0 comments


 
© 2008-2016 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top