VS not showing xaml changes when running: xap file doesn't update?


  • Hi,

    I'm creating a silverlight website for a college exam project.

    The solution was given to us, we only have to change the xaml (so the navigation/connection between the c#, xaml and asp part is working)

    When I change the xaml code, the preview is generated correctly, and when I open the xaml file in another project it shows the changes perfectly.

    But when I try to run it in VS 2010 (professional edition) I can't see any changes.

    The teacher said it had something to do with the xap file in the clientbin, which is indeed not updated if you check its date

    Is there a way to force that file to update, or do you perhaps suspect an other reason?

    Thank you all


    Thursday, May 12, 2011 11:38 AM

All replies

  • Hi Jess. Make sure you rebuild the project. Depending on how you start the application from Visual Studio, this may not be performed automatically. In Solution Explorer, right-click the Silverlight project and select "Build". If that doesn't work, you can also select "Rebuild", or first "Clean", then "Build". Do the same for the Web Application project.

    If the XAP file still doesn't update, the link between the Silverlight and Web Application project might be broken. Again in Solution Explorer, right-click the Web Application project this time, and select "Properties". In the upcoming screen, select "Silverlight Applications" to the left, and make sure your Silverlight project is listed there. If it's not, you can add it with the respective button.

    Thursday, May 12, 2011 12:37 PM
  • May be try clean the solution and rebuild the solution. On the solution right click and select clean solution and rebuild.

    If that doesnt work make sure the original given solution is rebuild and use that xap file


    Thursday, May 12, 2011 12:42 PM
  • Hi,

    Well it can happen for several reasons. Let's make a check point list validation:

    • Has been set on the target XAP file the readonly properly (source code version software)
    • Had your environment a Memory overflow exception during compilation?
    • Is your Silverlight project linked to a web application in the solution? If not try to do that; if yes... 
    • Are you compiling only the silverlight project or the web?
    • Have you verified that you are not having a Caching problem with your browser AND / OR IIS or web host?
    • Was the silverlight XAP file being used in that especific moment?

    I had quite similar experience in the past because of the source code control and the Caching of VS or IIS that can be resolve easily just deleting the XAP file and rebuilding the complete solution :)

    About the memory overflow... well; if you are having this experience normally means that your project has multiple and big resources or dependencies. One solution that normally works fine is to close the Visual studio forcing the system to clean up the memory and opening it again. 

    Let me know if you need more details in some of the mentioned points

    And good luck in the EXAM! :D

    Thursday, May 12, 2011 6:24 PM
  • Hi, thank you all for your replies!

    I found that when I installed the silverlight for VS 2010 it suddenly worked. The Xap files were refreshed.

    Yesterday it worked, but when I reopened VS today it suddenly went back to the problematic state.

    Reinstalling silverlight for VS 2010 doesn't change anything anymore.

    Does any of you know how to solve this?

    Thank you very much!

    Saturday, May 14, 2011 1:45 PM
  • Hi,

    Try to run the VS as administrator, right click the VS shortcut and click "Run as Administrator", if the problem get away, that means your current login account does not have privilege to write data to the folder, please give the privileges to the current account. If still not, please let me know, I will report it.

    Sunday, May 15, 2011 11:50 PM
  • It seems that your web browser is caching your silverlight application that is why you can't see your modifications. Try clearing your web  browser's browsing history and re-run the application.

    Sunday, November 20, 2011 1:14 AM
  • Jessidy, the answer above teaches you how to think logically, and how to troubleshoot a problem down to its root causes. It is the fastest way to identify why your XAML changes aren't showing up.

    Sunday, November 20, 2011 6:05 PM