Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 117531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:21:04+00:00 2026-05-11T03:21:04+00:00

How do I tell NAnt to use the same VB compiler VS2008 uses when

  • 0

How do I tell NAnt to use the same VB compiler VS2008 uses when it creates .NET 2.0-targeting applications?

I have switched a web application to VS2008 back-targetted to .NET 2.0. I can run NAnt (0.85rc4, 0.85, and 0.86b1) just fine once I do this. When I try to use some of the VB9 syntax, that still compiles just fine back to a .NET 2.0 binary in VS2008, NAnt gets the kind of compile error you would get if you tried to do the new syntax in VS2005 (where it wasn’t supported).

In case it helps, here is a simplified version of what I am attempting, just a simple anonymous delegate that works great until I try to use NAnt to build the 2.0 app instead of VS2008.

Public Class SomeObject     Public Name As String End Class Private SomeList As List(Of SomeObject) = SomeObject.GetAllSomeObjects() Public Function FindFirstItemWithSimilarName(ByVal x As String) As SomeObject     Return SomeList.Find(Function(p As SomeObject) p.Name.Contains(x)) End Function 

EDIT: Unless someone can think of a reason not to, the current setting in my build file is this (since I do indeed want a .NET 2.0 application, just one generated by a more robust VB compiler):

<property name='nant.settings.currentframework' value='net-2.0'/> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:21:05+00:00Added an answer on May 11, 2026 at 3:21 am

    I was being a little to literal in my expectations of NAnt. Since I was using NAntContrib to run msbuild on the projects, I did want the net-3.5 framework for NAnt. MSBuild and the project file take care of the back-targeting of the project to .NET 2.0. I was able to take my VB anonymous delegate, compile it to 3.5 and drop the generated DLL right onto a machine with only .NET 2.0 and it ran fine.

    Simply set the project to compile to .NET 2.0: Project Properties -> Compile [tab] -> Advanced Compile Options… -> Target framework (all configurations): .NET Framework 2.0

    …and tell NAnt to blindly assume net-3.5:

    <property name='nant.settings.currentframework' value='net-3.5'/> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It depends on whether the setting you have chosen is… May 12, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer You can either make AwesomeClass implement the nongeneric IComparable interface… May 12, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer You can submit the Eval result directly to your method… May 12, 2026 at 12:10 am

Related Questions

How do I tell my new employer that I can’t use the computer they gave me?
How do I tell Subversion (svn) to treat a file as a binary file?
How do I tell if my application (compiled in Visual Studio 2008 as Any CPU )
How do I tell the Vim editor about my include files path so that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.