Martin Brown
Martin Brown

Reputation: 25310

How do you get Visual Studio to recognise XAML changes?

I have just started with WPF so am probably missing something simple here. I have a window that I am editing in VS 2010. When I change the XAML by hand and then run the application (F5) the window remains as before my edit, however if I do a rebuild and then run the application my changes show up.

Is there any way to get VS to recognise that I have changed my XAML file and recompile it automatically when I press F5?

Upvotes: 5

Views: 3578

Answers (3)

Adrian Marte
Adrian Marte

Reputation: 3

What worked for me in Visual Studio 2012:

  1. Go to Tools -> Options -> Projects and Solutions -> Build and Run
  2. For "On Run, when projects are out of date" select "Always build"
  3. Uncheck "Only build startup projects and dependencies on Run"

Upvotes: 0

Martin Brown
Martin Brown

Reputation: 25310

It turns out that my UI project was not set to build in the configuration I had selected. Although it was set to build in Debug x86 I had set the current config to Debug Any CPU.

Upvotes: 4

akjoshi
akjoshi

Reputation: 15772

You can change a VS setting to save all files before Build/Run. Go to

Tools->Options->Projects and Solutions->Build and Run

Update Before building and On Run, when projects are out of date values to Save all changes and Always build respectively.

Upvotes: 0

Related Questions