How to compile just one file in c#?

前端 未结 7 1264
星月不相逢
星月不相逢 2020-12-28 15:54

In VC++ I can press CTRL+F7 to compile a single file, or right click on a source file ot compile it. Is it possible to compile a single file (or current file) in C#?

7条回答
  •  温柔的废话
    2020-12-28 16:36

    In command line: %windir%\Microsoft.Net\framework\V3.5\csc.exe /target:library File.cs

    You could reasonably attach this to the solution explorers context menu through Tools->External Tools

    set the arguments to /target:library $(ItemPath)

    something like that might do what you want. Though the file would have to depend on no other files in the project or in referenced binaries aside from what's in the GAC.

提交回复
热议问题