我正在尝试创建一个不使用VS2010中的自动生成文件的wpf项目,我认为它可以帮助我更好地理解,所以我希望这听起来不是超级原始的问题.
无论如何,在使xaml文件及其代码落后于例如myWindow.xaml和myWindow.xaml.cs我还创建了App.xaml及其代码.
在我运行代码并收到此消息之前,事情似乎还可以:
‘test1.exe’ does not contain a static ‘Main’ method suitable for an
entry point
这是我到目前为止:
<Application x:Class="test1.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="myWindow.xaml"> <Application.Resources> </Application.Resources> </Application> namespace test1 { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { public App() { InitializeComponent(); } } }
然后有
<Window x:Class="test1.myWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" > <Grid> </Grid> </Window> namespace test1 { /// <summary> /// Interaction logic for myWindow.xaml /// </summary> public partial class myWindow : Window { public myWindow() { InitializeComponent(); } } }