I tried to compile my class after placing it in the C:\nant\bin folder.My class file contains the following code.
Public Class Book
Private _title as String
Private _isbn as String
Private _author as String
Private _result as String
Private _profit as Double
Private _price as Decimal
Private _LocalPrice as Decimal
Private _LocalCur as String
Private _LocalCurSym as String
Public Sub New(NewTitle,NewIsbn,NewAuthor)
_title = NewTitle
_isbn = NewIsbn
_author = NewAuthor
End Sub
Public Property Title() as String
Get
return _title
End Get
Set(value as String)
_title = value
End Set
End Property
Public Property ISBN() as String
Get
return _isbn
End Get
Set(value as String)
_isbn = value
End Set
End Property
Public Property Author() as String
Get
return _author
End Get
Set(value as String)
_author=value
End Set
End Property
Public ReadOnly Property LocCurSym() as String
Get
return _LocalCurSym
End Get
End Property
Public ReadOnly Property Profit() as Double
Get
return _profit
End Get
End Property
Public ReadOnly Property Result() as String
Get
return _result
End Get
End Property
Public ReadOnly Property LocalPrice() as Decimal
Get
return _LocalPrice
End Get
End Property
Public Sub ConLocal(LocCur as String)
_LocalCurSym = LocCur
Select Case LocCur
Case "US Dollar"
_LocalPrice = _price
_LocalCurSym = "$ "
Case "Rupees"
_LocalPrice = _price * 60.00
_LocalCurSym = "Rs."
Case "Canadian Dollar"
_LocalPrice = _price * 43.50
_LocalCurSym = "$ "
End Select
End Sub
Public Sub CalcProfit(CostPrice as Double,RetailPrice as Double)
If (CostPrice <= 500 And RetailPrice <= 500) Then
_price = RetailPrice
_profit = RetailPrice - CostPrice
Select Case _profit
Case 0
_result = "No Profit No Loss"
Case > 0
_result = "Profit"
Case < 0
_result = "Loss"
End Select
Else
Exit Sub
End If
End Sub
End Class
I named it as Book.Class and then executed the nant -buildfile:Book.class.
This is what i got:
NAnt version 0.8.3 Copyright (C) 2001-2003 Gerry Shaw
http://nant.sourceforge.net
C:\nant\bin\Book.Class(1,1):
Error loading buildfile
There is invalid data at the root level. Line 1, position 1.
For more information regarding the cause of the build failure, enable log4net us
ing the instructions in NAnt.exe.config and run the build again.
Try 'nant -help' for more information
Could you tell me how to sort out this problem, again thanx for your precious support.
CEO InteliSoft
Maqsood ur Rahman