2

I am working on a Windows 8 Store app project (C#).

The application project files reside in a root folder, where each supported platform's specific files are placed inside its own folder:

 ROOT  
  |-- Application.Windows8.csproj  
  |-- Application.OtherPlatform.csproj
  |--
  |-- Windows8
          |-- App.xaml
          |-- Other Win8 related files

My Windows8 project includes all files under the Windows8 folder, including App.xaml.

When attempting to use this structure, i am getting an error when building the project:

The Application main file must be named App.xaml

Is it possible to keep the App.xaml in a folder that is not the same one as the csproj file ?

UPDATE:

I have opened a ticket on MS Connect, since the documentation never specified it is required for this file to be located in the root folder: http://connect.microsoft.com/VisualStudio/feedback/details/776168/windows-8-store-app-project-doesnt-compile-if-app-xaml-is-placed-in-a-subfolder

1
  • I noticed another thing while developing windows store app that if you try to change the entry point of a windows store app project from App.xaml to a new xaml file let's say "MainApp.xaml" in Package.appxmanifest file even then it gives the same error "The Application main file must be named App.xaml". I changed the build action attribute in properties window for "MainApp.xaml" to "ApplicationDefiition" even then it doesn't help. App.xaml is THE HARD-CODED ENTRY POINT for windows store apps which can't be changed. Though there is hardly ever a need to do so but a good to know fact.
    – RBT
    Apr 11, 2015 at 8:08

1 Answer 1

2

It is not possible due to restriction on Windows Store Application.

From MSDN -> Application class

Note The Application main file must be named App.xaml.

There is no such restriction on normal WPF apps.

1
  • The file is named app.xaml. Where does it say it is required to reside in the project's root folder? Jan 9, 2013 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.