FAQ: IDE Support for Nu
Can I use my existing IDE?
Yes, you can use your existing IDE and Nu together. Typically, you
will need to add a post-build phase to your IDE.
How can I compile using Nu inside visual studio?
Add a post build event to your Visual Studio project. This
way the Nu IL transformer will be executed from inside
Visual Studio. It's very simple to add:
Step 1: Go to Projects/Properties/Common Properties/Build Events/Post Build
Event Command Line.
Step 2: Add 'NU_PATH\bin\Nu.exe "$(TargetDir)\$(TargetFileName)"' in the blank
line and you can compile your project in visual studio as usual. Here
$(TargetDir) is a visual studio macro representing the directory in which
your target assembly is generated and $(TargetFileName) is a visual studio
macro that represents the name of the generated assembly. Visual studio
automatically expands these macros, replacing them with the correct strings.
Replace "NU_PATH" with the path to your Nu distribution. Note the quotes around
the target. This is required if the target path contains spaces
(for example: "user\Documents and Settings\My Documents").
Under the hood Visual Studio just adds a batch file containing the following
code into the output directory. If you prefer or if you have already
have another post build event, you can also edit this file.
@echo off
..\..\..\bin\Nu.exe originial.exe
if errorlevel 1 goto CSharpReportError
goto CSharpEnd
:CSharpReportError
echo Project error: A tool returned an error code from the build event
exit 1
:CSharpEnd