一个Txt文件,文件名为HelloWPF.txt,路径为F:\C#Code\WPF\20200830_TimLiu01
文件内容为:
namespace MyApp{class Program{static void Main(string[] args){System.Windows.MessageBox.Show("Hello,WPF!");}}}
在x64 Native Tools Command Prompt for VS 2019 C#编译器中执行
cd F:\C#Code\WPF\20200830_TimLiu01
f:
dir
csc /r:”C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\PresentationFramework.dll” /t:exe HelloWPF.txt(将生成带控制台的exe)
csc /r:”C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\PresentationFramework.dll” /t:winexe HelloWPF.txt(将生成不带控制台的exe)

