Geeks With Blogs

Soppa Group India
iSmart Panache Inc
R Systems Internationals Ltd
Technovate eSolutions Pvt Ltd
The contents of this blog are my personal opinion and do not represent in any way the view of my employer.
These postings are provided "AS IS" with no warranties, and confer no rights.

Google PR™ - Post your Page Rank with

Narendra Tiwari

Ndoc Part – II
Ndoc with MSBuild

In above script I used NDoc which is provided by MSBuild Community Tasks.

<Project DefaultTargets=“NDoc” xmlns=“”>

  <Import Project= “$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets”/>






  <Target Name=“NDoc” >

    <MakeDir Directories =“$(BuildDirectory)\Documentation”/>

    <NDoc Documenter=“MSDN” ProjectFilePath=“E:\ndoc\myproject.ndoc”

                    NdocToolPath=“E:\NDoc 1.3.1” />




We have to install it and use it as shown in above script.

Now here i made a small change in the source code for NDoc task, NdocToolPath looks for the Ndoc exe in “Program files” folder which is not correct we can have the exe anywhere. I've following commented Method GenerateFullPathToTool was replaced by uncommented one.


/// Returns the fully qualified path to the executable file.


/// The fully qualified path to the executable file.

protected override string GenerateFullPathToTool()


return _ndocToolPath + “\\NDocConsole.exe”;



//protected override string GenerateFullPathToTool()


//    string ndocPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

//    ndocPath = Path.Combine(ndocPath, @”NDoc 1.3\bin\net\1.1”);

//    try

//    {

//        using(RegistryKey buildKey = Registry.ClassesRoot.OpenSubKey(@”NDoc Project File\shell\build\command”))


//            if (buildKey == null)

//            {

//                Log.LogError(“Could not find the NDoc Project File build command. Please make sure NDoc is installed.”);

//            }

//            else

//            {

//                ndocPath = buildKey.GetValue(null, ndocPath).ToString();

//                Regex ndocRegex = new Regex(“(.+)NDocConsole\\.exe”, RegexOptions.IgnoreCase);

//                Match pathMatch = ndocRegex.Match(ndocPath);

//                ndocPath = pathMatch.Groups[1].Value.Replace(“\”“, ““);

//            }

//        }               

//    }

//    catch (Exception ex)

//    {

//        Log.LogErrorFromException(ex);

//    }

//    base.ToolPath = ndocPath;

//    return Path.Combine(ToolPath, ToolName);


Posted on Thursday, March 9, 2006 1:21 PM .Net | Back to top

Comments on this post: Generate .NET XML Documentation With NDoc: Part II

# re: Generate .NET XML Documentation With NDoc: Part II
Requesting Gravatar...
That was an inspiring post,

but what are those comment codes in this article!!

Thanks for bringing this up
Left by web development company on Aug 21, 2009 9:23 PM

Your comment:
 (will show your gravatar)

Copyright © Narendra Tiwari | Powered by: