Hi.

I am trying to use NAnt.Core.dll v0.85 from a vs 2008 .net web application.

I added a reference to the dll in my project and then tried to use the
following c# code:

                Project nantProj = new Project(buildFile, Level.Info, 0);

                BuildListenerCollection listeners = new
BuildListenerCollection();
                IBuildLogger buildLogger = null;
                buildLogger = new DefaultLogger();
                buildLogger.Threshold = nantProj.Threshold;
                buildLogger.EmacsMode = false;
                listeners.Add(buildLogger);
                nantProj.AttachBuildListeners(listeners);

                nantProj.Execute("clean");

But I get the following exception:

The current runtime framework 'net-2.0' is not correctly configured in the
NAnt configuration file.: NAnt.Core.BuildException: The current runtime
framework 'net-2.0' is not correctly configured in the NAnt configuration
file. ---> Invalid element . Unknown task or datatype.:
NAnt.Core.BuildException: Invalid element . Unknown task or datatype. at
NAnt.Core.Project.InitializeProjectDocument(XmlDocument doc) at
NAnt.Core.Project.Execute() at
NAnt.Core.ProjectSettingsLoader.ProcessFrameworks(XmlNode platformNode) ---
End of inner exception stack trace --- at
NAnt.Core.ProjectSettingsLoader.ProcessFrameworks(XmlNode platformNode) at
NAnt.Core.ProjectSettingsLoader.ProcessPlatform(XmlNode platformNode) at
NAnt.Core.ProjectSettingsLoader.ProcessSettings() at
NAnt.Core.Project.CtorHelper(XmlDocument doc, Level threshold, Int32
indentLevel, Optimizations optimization) at NAnt.Core.Project..ctor(String
uriOrFilePath, Level threshold, Int32 indentLevel) at <mycode>

I tried to add both the <log4net> and <nant> elements (with their
corresponding section definitions) from NAnt.exe.config to my web.config but
that did not make any difference.

I also have log4net referenced in my project.

Any ideas?

Thank you very much.
------------------------------------------------------------------------------
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to