命令行编译WPF--VS2010

http://blog.csdn.net/eldersubhuti/archive/2010/07/07/5719160.aspx
//SayHello.cs
using System;
using System.Windows;
class SayHello
{
    [STAThread]
    public static void Main()
    {
        Window win = new Window();
        win.Title = "Say Hello";
        win.Show(); 
        Application app = new Application();
        app.Run();
    }
}

Notepad++中 RunC#.bat
rem "C:/Program Files/Notepad++/RunC#.bat" "$(CURRENT_DIRECTORY)"
set cur_path=%1%
set root_path=%cur_path:~1,1%
%root_path%:
cd %1
set WPF_DIR=C:/Program Files/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0
set WPF_REF=/reference:"%WPF_DIR%/PresentationFramework.dll"
set WPF_REF=%WPF_REF% /reference:"%WPF_DIR%/WindowsBase.dll"
set WPF_REF=%WPF_REF% /reference:"%WPF_DIR%/PresentationCore.dll"
set WPF_REF=%WPF_REF% /reference:"%WPF_DIR%/System.Xaml.dll"
%comspec% /k ""C:/Program Files/Microsoft Visual Studio 10.0/VC/vcvarsall.bat"" x86

编译命令: csc SayHello.cs /target:exe  %WPF_REF%
或 csc SayHello.cs /target:winexe %WPF_REF%

你可能感兴趣的:(application,System,exe,Path,WPF,2010)