I'm having trouble writing a NPPExec script (for Notepad++) to compile C# source using Microsoft's csc.exe. I had no problem getting MinGW up and running for my c++ stuff, but the same script structure doesn't seem to work for C#. Does anybody have a working C# NPPExec script?
Three quick notes:
While my mingw installed to a path with no spaces (\MinGW\bin), it appears that my C# compiler is buried in \Program Files\, a path with multiple spaces. Does this matter?
I was able to compile using the Microsoft SDK-installed command prompt (which I think sets some environment variables), so I know the compiler works.
In the NPPExec option box, I have selected FOLLOW $(CURRENT_DIRECTORY). Does this matter?
Thanks.
Here is my nppexec script for C# (.NET 3.5) to compile the currently opened file and run:
"c:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" /out:"$(FULL_CURRENT_PATH).exe" "$(FULL_CURRENT_PATH)"
"$(FULL_CURRENT_PATH).exe"
In the "Plugins -> NppExec" menu:
Select "Save all files on execute"
Select "Follow $(CURRENT_DIRECTORY)".
Answers for your questions:
1) Use double quotes (") for full path of csc like my configuration.
2) At least for .NET 3.5, only full path to csc is enough, no need to load VS environment variables.
3) It is better to select "FOLLOW $(CURRENT_DIRECTORY)" so that the compiled EXE is under the same directory.