0
我正嘗試通過自定義腳本(如下)使用msbuild構建一個簡單的WPF應用程序。該項目通過Visual Studio構建和執行,但如果使用msbuild腳本,它將成功構建並生成可執行文件,但在啓動時立即崩潰(使用「WPFApplication has stopped working」錯誤消息)。通過msbuild使用XAML構建WPF應用程序
有沒有人遇到過這種情況,或者有什麼建議可以嘗試?
謝謝!
構建腳本
<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>