<p>I have taken over the development of a web application that is targeted at the .net 1.0 framework and is written in C# and Visual Basic. </p>

<p>I decided that the first thing we need to do is refine the build process, I wrote build files for the C# projects, but am having tons of problems creating a build file for Visual Basic. </p>

<p>Admittedly, I do not personally know VB, but it seems like I have to hardcode all the imports and references in my build file to get anything to work...certainly not the best way to be doing things...</p>

<p>For any example: if I do not include the namespace System in the build file I will get several errors of common Unkown Types e.g: Guid</p>

<p>does NAnt typically require this for VB code or is does the VB code need a possible NAnt-freindly refactoring?</p>

<p>Does anybody have VB NAnt tips?</p>

[{'answer_id': 13933, 'author': 'John Smithers', 'author_id': 1069, 'author_profile': 'https://Stackoverflow.com/users/1069', 'pm_score': 1, 'selected': False, 'text': '<p>I\'m not sure, if you talk about VB or VB.Net.<br>\nEither way, have a look at <a href="http://nantcontrib.sourceforge.net/release/latest/help/tasks/" rel="nofollow noreferrer">Nant Contrib</a>. Maybe they have a solution.</p>\n'}, {'answer_id': 16986, 'author': 'slolife', 'author_id': 698, 'author_profile': 'https://Stackoverflow.com/users/698', 'pm_score': 1, 'selected': False, 'text': "<p>Are you calling msbuild to build? Or are you calling the VS.NET IDE exe to build.  We've had no problems with our c#/VB.NET mix using CC.NET and NAnt and do not have to specify referenced assemblies inside of the build files.</p>\n\n<p>What we do is using the IDE exe to build solutions that contain the projects we want to build.</p>\n"}, {'answer_id': 32391, 'author': 'RobertTheGrey', 'author_id': 1107, 'author_profile': 'https://Stackoverflow.com/users/1107', 'pm_score': 1, 'selected': False, 'text': '<p>I would recommend that you take the language specific compilers out of the equation for this one. And you can still use NAnt to do this:</p>\n\n<p>First start off with a target that uses MSBuild because that will compile your project regardless of language used and take care of the dependencies for you. That means you don\'t need to hard code them in.</p>\n\n<p>Example:</p>\n\n<pre><code>&lt;target name="WinBuild"&gt;\n  &lt;exec program="msbuild.exe"\n        basedir="${DotNetPath}"\n        workingdir="${SolutionPath}"\n        commandline="MySolution.sln \n                     /nologo /verbosity:normal /noconsolelogger \n                     /p:Configuration=Debug /target:Rebuild" /&gt;\n&lt;/target&gt;\n</code></pre>\n\n<p>I think once you\'ve got that nailed - you can spend plenty of time trying to get NAnt to compile natively, but in my opinion, this is what I would use for this project since it seems to be a once off?</p>\n\n<p>Hope that helps,</p>\n\n<p>Cheers,</p>\n\n<p>Rob G</p>\n'}, {'answer_id': 470843, 'author': 'Peaeater', 'author_id': 9432, 'author_profile': 'https://Stackoverflow.com/users/9432', 'pm_score': 2, 'selected': False, 'text': '<p>I have had a similar experience with NAnt and the vbc compiler for VB.NET projects that are developed with Visual Studio. My solution has been to avoid importing namespaces at the project level in Visual Studio (which occurs by default), and use explicit Imports statements at the class/file level. C# projects work this way by default (no project level namespace imports), and I like the extra information provided by explicit namespace directives when looking at a file.</p>\n\n<p>Interesting that VB.NET and C# VS projects are so different in that respect.</p>\n'}]
['https://Stackoverflow.com/questions/13832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1638/']