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 959929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:06:07+00:00 2026-05-16T01:06:07+00:00

I am attempting to build a simple WPF Application using msbuild via a custom

  • 0

I am attempting to build a simple WPF Application using msbuild via a custom script (below). The project builds and executes fine through Visual Studio, however if I use the msbuild script it builds successfully, and generates the executable, but crashes immediately on startup (with a “WPFApplication has stopped working” error message).

Has anyone experienced this before, or have any suggestions for things to try?

Thanks!

Build Script

    <PropertyGroup>
        <AssemblyName>WPFApplication</AssemblyName>
        <OutputType>winexe</OutputType>
    </PropertyGroup>

    <ItemGroup>
         <Reference Include="System" />
         <Reference Include="WindowsBase" />
         <Reference Include="PresentationCore" />
         <Reference Include="PresentationFramework" />
     </ItemGroup>

    <ItemGroup>
         <ApplicationDefinition Include="WpfBuild\WpfBuild\App.xaml" />
         <Compile Include="WpfBuild\WpfBuild\App.xaml.cs" />
         <Page Include="WpfBuild\WpfBuild\Window1.xaml" />
         <Compile Include="WpfBuild\WpfBuild\Window1.xaml.cs" />
     </ItemGroup>

     <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
     <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />

</Project>
  • 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-16T01:06:08+00:00Added an answer on May 16, 2026 at 1:06 am

    Edit the csproj file and put a line similar to this near the end, near to the line with “Microsoft.CSharp.targets” in it:

    <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
    

    See http://msdn.microsoft.com/en-us/library/aa970678%28VS.85%29.aspx

    I’m currently looking for answers to something similar. I found another SO link wpf-app-builds-in-vs2k8-but-not-on-command-line-w-msbuild

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

Sidebar

Related Questions

I am attempting to build a simple application using wicket and have been impressed
I'm attempting to build a JSF/Hibernate application using Java 7 and Tomcat 7. I
I am attempting to build a simple content management system using Twitter's Bootstrap for
I'm not sure if I'm using classes correctly. I'm attempting to build a simple
I'm using System.Linq.Expressions I was attempting to build a simple LambdaExpression that includes a
I am a newcomer to WPF, attempting to build a project that follows the
I'm attempting to build a simple plugin like this (function($) { $.fn.gpSlideOut = function(options,
Attempting to build a C# project which has numerous references to assemblies in NuGet
I am attempting to build a backup script that moves a tar file from
I'm attempting to build an app using the Sencha Touch 2 builder tools. I

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.