Steve,
Are you sure that both the Release and Debug versions are being built
from scratch?
I created a solution similar to yours, built it with "Debug", and
discovered that when I built it with "Release" it didn't actually build.
The "Release" version says that the project is up-to-date.
I discovered that, unlike C#, the VB executable is placed directly in
the bin directory and not in a subdirectory (Debug or Release).
Therefore, if the "Debug" is built first and no changes are made to the
source files, the "Release" executable won't be built because the
"Debug" executable is in the bin directory and is up-to-date.
It looks like the solution task needs a "rebuild" option similar in
operation to devenv.
<exec program="devenv.exe" verbose="true" >
<arg file="${RootDir.Solution}\StorefrontSolution.sln"
/>
<arg value="/out" />
<arg value="${RootDir.Builds}\build.out" />
<arg value="/rebuild" />
<arg value="${Build.Type}" /> <!-- "Debug" or "Release"
-->
</exec>
Below is the output of the run that I did for experimenting (using the
<solution> task:
1) execute target "withDebug"
2) display bin directory
3) execute target "withRelease" -- doesn't build (up-to-date)
4) delete bin directory
5) execute target "withRelease" -- builds and works
Noel
<project name="VBDebugTest" default="Test">
<target name="withDebug">
<solution configuration="Debug"
solutionfile="VBDebugTest.sln" verbose="True" />
</target>
<target name="withRelease">
<solution configuration="Release"
solutionfile="VBDebugTest.sln" verbose="True" />
</target>
</project>
withDebug:
[solution] Starting solution build.
[solution] Loading projects...
[solution] Loading project
'C:\Projects\VBDebugTest\VBDebugTest.vbproj'.
[solution] Gathering additional dependencies...
[solution] Fixing up references...
[solution] Building 'VBDebugTest' [Debug]...
[solution] Copying references:
[solution] Compiling resources:
[solution] - C:\Projects\VBDebugTest\Form1.resx
[resgen] Output file
'C:\Projects\VBDebugTest\obj\Debug\VBDebugTest.Form1.resources' does not
exist, reco
mpiling.
[resgen] Starting
'C:\DOCUME~1\ngifford\LOCALS~1\Temp\60f7b77005a54e2f809ff8c7bdc0f6ca\res
gen.exe ( "C:\P
rojects\VBDebugTest\Form1.resx"
"C:\Projects\VBDebugTest\obj\Debug\VBDebugTest.Form1.resources")' in
'C:\DOCUME~1\ngiffo
rd\LOCALS~1\Temp\60f7b77005a54e2f809ff8c7bdc0f6ca'
[resgen] Read in 13 resources from
'C:\Projects\VBDebugTest\Form1.resx'
[resgen] Writing resource file... Done.
[solution] Starting compiler...
[solution] Commands:
[solution] /target:winexe
[solution] /nologo
[solution] /rootnamespace:VBDebugTest
[solution] /optionexplicit+
[solution] /optionstrict-
[solution] /optioncompare:binary
[solution] /main:"VBDebugTest.Form1"
[solution] /d:DEBUG=true
[solution] /d:TRACE=true
[solution] /baseaddress:11000000
[solution] /optimize-
[solution] /debug+
[solution] /warnaserror-
[solution]
/out:"C:\Projects\VBDebugTest\bin\VBDebugTest.exe"
[solution]
/Imports:Microsoft.VisualBasic,System,System.Collections,System.Data,Sys
tem.Drawing,System.D
iagnostics,System.Windows.Forms,
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Xml.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
[solution]
/res:"C:\Projects\VBDebugTest\obj\Debug\VBDebugTest.Form1.resources","VB
DebugTest.Form1.reso
urces"
[solution] "C:\Projects\VBDebugTest\Form1.vb"
[solution] "C:\Projects\VBDebugTest\AssemblyInfo.vb"
[solution] Success! (exit code = 0)
Build succeeded
Total time: 2.6 seconds.
C:\Projects\VBDebugTest>dir bin
Volume in drive C has no label.
Volume Serial Number is 189E-245F
Directory of C:\Projects\VBDebugTest\bin
08/03/2004 08:30 AM <DIR> .
08/03/2004 08:30 AM <DIR> ..
08/03/2004 08:30 AM 9,728 VBDebugTest.exe
08/03/2004 08:30 AM 15,872 VBDebugTest.pdb
2 File(s) 25,600 bytes
2 Dir(s) 14,799,433,728 bytes free
C:\Projects\VBDebugTest>bin\vbdebugtest
C:\Projects\VBDebugTest>nant\bin\nant withRelease
NAnt 0.85 (Build 0.85.1664.0; net-1.0.win32; nightly; 7/22/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/Projects/VBDebugTest/Test.build
Target(s) specified: withRelease
withRelease:
[solution] Starting solution build.
[solution] Loading projects...
[solution] Loading project
'C:\Projects\VBDebugTest\VBDebugTest.vbproj'.
[solution] Gathering additional dependencies...
[solution] Fixing up references...
[solution] Building 'VBDebugTest' [Release]...
[solution] Project is up-to-date.
Build succeeded
Total time: 0.2 seconds.
C:\Projects\VBDebugTest>bin\vbdebugtest
C:\Projects\VBDebugTest>del bin
C:\Projects\VBDebugTest\bin\*, Are you sure (Y/N)? y
C:\Projects\VBDebugTest>nant\bin\nant withRelease
NAnt 0.85 (Build 0.85.1664.0; net-1.0.win32; nightly; 7/22/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/Projects/VBDebugTest/Test.build
Target(s) specified: withRelease
withRelease:
[solution] Starting solution build.
[solution] Loading projects...
[solution] Loading project
'C:\Projects\VBDebugTest\VBDebugTest.vbproj'.
[solution] Gathering additional dependencies...
[solution] Fixing up references...
[solution] Building 'VBDebugTest' [Release]...
[solution] Copying references:
[solution] Compiling resources:
[solution] - C:\Projects\VBDebugTest\Form1.resx
[solution] Starting compiler...
[solution] Commands:
[solution] /target:winexe
[solution] /nologo
[solution] /rootnamespace:VBDebugTest
[solution] /optionexplicit+
[solution] /optionstrict-
[solution] /optioncompare:binary
[solution] /main:"VBDebugTest.Form1"
[solution] /d:DEBUG=false
[solution] /d:TRACE=true
[solution] /baseaddress:11000000
[solution] /optimize+
[solution] /debug-
[solution] /warnaserror-
[solution]
/out:"C:\Projects\VBDebugTest\bin\VBDebugTest.exe"
[solution]
/Imports:Microsoft.VisualBasic,System,System.Collections,System.Data,Sys
tem.Drawing,System.D
iagnostics,System.Windows.Forms,
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Xml.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll"
[solution]
/r:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
[solution]
/res:"C:\Projects\VBDebugTest\obj\Release\VBDebugTest.Form1.resources","
VBDebugTest.Form1.re
sources"
[solution] "C:\Projects\VBDebugTest\Form1.vb"
[solution] "C:\Projects\VBDebugTest\AssemblyInfo.vb"
[solution] Success! (exit code = 0)
Build succeeded
Total time: 0.5 seconds.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, August 02, 2004 11:54 PM
To: [EMAIL PROTECTED]
Subject: [Nant-users] <Solution> task and conditional compilation
I'm having a problem using the <solution> task and conditional
compilation.
Our solution uses 2 keys one for development and one for production.
The keys are defined in the assemblyInfo.vb file as follows...
#If DEBUG Then
<Assembly: AssemblyKeyFile("../../../../DevelopmentKeyfile.snk")>
#Else
<Assembly: AssemblyKeyFile("e:\ProdcutionKeyfile.snk")>
#End If
The project configuration is ...
<Config
Name = "Debug"
BaseAddress = "285212672"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "true"
DefineTrace = "true"
DebugSymbols = "true"
IncrementalBuild = "true"
Optimize = "false"
OutputPath = "..\..\..\..\..\bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
<Config
Name = "Release"
BaseAddress = "285212672"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "false"
DefineTrace = "true"
DebugSymbols = "false"
IncrementalBuild = "false"
Optimize = "true"
OutputPath = "..\..\..\..\..\bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
The problem is when I build the solution with the <soulution> tasks
configuration attribute set to configuration="Debug" it always tries and
builds with the production keyfile e:\ProdcutionKeyfile.snk instead of
the
DevelopmentKeyfile.snk keyfile.
Any suggestions would be greatly appreciated.
p.s. Please note for various reasons we are not able to use delayed
signing
Cheers,
Steve
This email is sent by or on behalf of the named sender identified above.
If:
(a) you do not wish to receive any email marketing material from me in
the
future, please forward the contents of this email with the message
'unsubscribe' in the subject box to [EMAIL PROTECTED]; or
(b)you wish to unsubscribe from all central email marketing lists used
by
our business,please forward the contents of this email,with the message
'unsubscribe from all central email marketing lists' in the subject box
to
[EMAIL PROTECTED]
The information contained in this e-mail communication may be
confidential.
You should only read, disclose, re-transmit,copy,distribute, act in
reliance on or commercialise the information if you are authorised to do
so. If you are not the intended recipient of this e-mail communication,
please immediately notify us by e-mail to [EMAIL PROTECTED], or
reply
by e-mail direct to the sender and then destroy any electronic and paper
copy of this message. Any views expressed in this e-mail communication
are
those of the individual sender, except where the sender specifically
states
them to be the views of a member of the National Australia Bank Group of
companies. Any advice contained in this e-mail has been prepared
without
taking into account your objectives, financial situation or needs.
Before
acting on any advice in this e-mail, National Australia Bank Limited
recommends that you consider whether it is appropriate for your
circumstances. If this e-mail contains reference to any financial
products,
the National recommends you consider the Product Disclosure statement
(PDS)
or other disclosure document before making any decisions regarding any
products. The National Australia Bank Group of companies does not
represent, warrant or guarantee that the integrity of this communication
has been maintained nor that the communication is free of errors, virus
or
interference.
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users