tags:

views:

531

answers:

2

In the process of refactoring some code I encountered several build errors like these:

Library project file cannot specify ApplicationDefinition element.

The project file contains a property value that is not valid.

How can these errors be resolved?

+2  A: 

The build action on the Xaml control must be change from ApplicationDefinition to Page (this property can be accessed by right clicking on the control in the Solution Explorer treeview and selecting properties).

dmo
+10  A: 

When you copy and paste files either within a project or to another project, Visual Studio has a nasty habit of not keeping the same BuildAction property. It often changes the build action to a seemingly random value, e.g. ApplicationDefinition, which causes that build error.

Check (in the Visual Studio properties window with the file selected in the Solution Explorer) that each of your .xaml files have a BuildAction property of Page and your code files have a BuildAction property of Compile.

fubaar
Weird - i split my XAML files into 2 more DLLs. All my pages were marked with AppDef and my App.xaml was marked as Page :) Thanks for the post, they need to either fix the IDE or at the very least improve the error message on this one (shine some light on the cause)
Gishu