开发者

How do I suppress warnings in NAnt when using the solution task?

We have a .NET 1.1 solution that we are compiling using NAnt with a "solution" task.

One of the projects throws multiple warnings for missing XML comments. I know which warnings I need to suppress (from http://bytes.com/topic/net/answers/177026-suppress-missing-xml-comment-warning-during-compile), but I can't see how. The csc task has a configuration element that can be used for 开发者_如何学运维this, but I can't see an equivalent for solution.

Is this even possible? How can I do it?


Replace NAnt's <solution> task by NAntContrib's <msbuild> task. You can pass solution files to MSBuild as well as project files and you can pass MSBuild properties like WarningLevel then. Find an example here.


I tend to prefer running an exec task for msbuild. This will suppress all warnings:

<exec program="${msbuild_exe_path}">
   <arg line='"${solution_path}"' />
   <arg line="/property:WarningLevel=0" />
   <!-- SNIP  -->           
</exec>

More info on warning level settings: http://msdn.microsoft.com/en-us/library/13b90fz7.aspx

Getting msbuild to work on .net 1.1: http://blogs.msdn.com/b/jomo_fisher/archive/2004/11/29/271748.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜