Click here to Skip to main content
Click here to Skip to main content

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

By , 10 Aug 2010
 

In this Tips&Tricks, I will describe about changing the location of the output of your Silverlight application, i.e., the .XAP file from its 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 to relocate the XAP file.

Read the full post and if you have any queries or suggestions, please let me know. I appreciate your feedbacks.

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

  • 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 required. Else, the next step will generate a duplicate copy in both the locations while building the project.
  • Click on “Yes” in the dialog that pops up 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 pops up 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 ensures the aspx page will be replaced 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 an 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.


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

_ Kunal Chowdhury _
Software Developer
India India
Member
Kunal Chowdhury is a Microsoft MVP (Most Valuable Professional) in Silverlight Technology, a Codeproject MVP & Mentor, DZone MVB (Most Valuable Blogger), Speaker in various Microsoft events, Author, passionate Blogger and a Software Engineer by profession.
 
He is currently working as a Software Engineer II in an MNC located at Pune, India. He has a very good skill over XAML, C#, Silverlight and WPF. He has a good working experience in Windows 7 application (including Multi-touch) development too.
 
He posts his findings in his technical blog. He also writes for SilverlightShow and Codeproject portal. Many of his articles were highlighted as "Article of the Day" in Microsoft sites.
 
He also has another website called Silverlight-Zone.com where he posts article links on Silverlight, Windows Phone 7 and XNA accumulated from various web sites to help the community grow on specified technologies.
 
You can reach him in his Blog : http://www.kunal-chowdhury.com
He is also available in Twitter : http://twitter.com/kunal2383

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5 Pinmembervenugopalm11 Aug '10 - 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 10 Aug 2010
Article Copyright 2010 by _ Kunal Chowdhury _
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid