Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6765843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:45:37+00:00 2026-05-26T14:45:37+00:00

Previously all application level resources in a project I am authoring were stored in

  • 0

Previously all application level resources in a project I am authoring were stored in App.xaml. Then I decided to migrate from VS 2008 to 2010 and that is where the trouble started.

After migrating, I tried to do a little testing using a testing window instead of the normal startup window. After changing the startup object, suddenly I was faced with lots of compile errors and what not which (long story short) resulted in finding that there was now two files which held application level resources associated with the project: App.xaml (the original), and Application.xaml (at this time veritably empty). I migrated all of the resources (as well as merged dictionaries) over to the Application.xaml, and all was again right with the world so far as Visual Studio was concerned.

I then found out that Blend still wanted to use the App.xaml. I had created several resources and placed them in the Application.xaml, and saw that they were not being used when I compiled with Blend (but they were being used when I compiled with VS).

Where does one specify which XAML is the top level WPF resource file? This is getting out of hand…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:45:38+00:00Added an answer on May 26, 2026 at 2:45 pm

    There are slight differences in naming depending on what programming language you choose.
    Visual Basic WPF projects use Application.xaml, while C# projects name it App.xaml.

    As you probably know all .NET apps need a Main method. Also, windows apps need a message pump to get hooked to the Windows messaging system. IN WPF you can use the Application class to start listening to the windows messages.

    Here’s how you can do it explicitly.

    VB

    Public Class Startup
    
      <STAThread()>
      Shared Sub Main()
        Dim app As New Application()
        Dim window As New MainWindow()
    
        window.Show()
        app.Run()
    
      End Sub
    
    End Class
    

    C#

    public class Startup
        {
    
    
      [STAThread()]
      public static void Main()
      {
        Application app = new Application();
        MainWindow window = new MainWindow();
    
        window.Show();
        app.Run();
    
      }
    }
    

    Since creating this type of code is common for WPF applications you can tell MSBuild to write this code by defining a XAML file and class that derives from System.Windows.Application and specifing its build action as ‘ApplicationDefinition’.

    enter image description here

    In your situation, instead of editing the VbProj file, you could just select the correct file in Solution Explorer and change the BuildAction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are bringing a new project in house and whereas previously all our work
how can I make this jquery script close all previously opened children when entering
Continuing from my previous question , is there a comprehensive document that lists all
Previously I have asked to strip text from a field and convert it to
I am trying to deploy a ClickOnce app. It had worked previously when the
I posted one question previously and all of them answered that there is some
I am writing an application based on a COM object from a third party
I have an application that I've developed. Currently it is deployed with all its
I'd like a quick script to remove all applications from glassfish 3.1 from Netbeans.
Hey all, I'm writing an application which records microphone input to a WAV file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.