So I have been playing with this some more and I have some more context and a new theory. :-)
When you use Visual Studio to add a website from the file system, there is no *.[cs|vb]proj file. It's just a directory. And this is how it gets written to the VS2005 solution file, like so: Project("{GUID}") = "C:\...\PMI\", "RootNS.Web.Portal.UI.Search\PMI", "{GUID}" Now, add to that this known "feature" in Windows, where directories are read only and you can't effectively change it (BTW, their attrib work-around still leaves my directories read-only, but the files are fine and all other non-web NAnt solution tasks work flawlessly): http://support.microsoft.com/kb/326549/ When you use the NAnt <solution> task, it uses the solution file to figure out what projects to build and where they are located. In the case of web projects, it has <map> elements to convert the URLs to physical file paths. This is all well and good if you use IIS for your web projects. So here's the part where my "facts" turn to conjecture and hypothesis: Unfortunately, this seems to break-down when using path-based web projects. There is no effective way to use the <map> elements that I have found and left to its own devices, NAnt appears to try and "open" the directory it finds in the solution where it expects a project. Since the directory is read-only, I get the somewhat misleading, but perfectly accurate "access denied" error. Does anyone have any experience using NAnt in general and/or the <solution> task in particular to build file-based web site projects in Visual Studio 2005? Tony Tony Selke wrote: > I am converting our MSBuild scripts to NAnt and most of our solutions > have been happily compiling using the <solution> task. We do have a > handful of ASP.NET applications that need to be compiled as well, but I > am having trouble getting this to work. I am using the NAnt 0.86 > nightly build from 02-10-2008 so that I can get VS2005 support. I am > not running IIS and I would prefer not to need to do so on my build server. > > My simplest example is a “test wrapper” web site that is the testing > project for a custom WebPart. This solution has one project that > generates a class library (with the web part) and another “project” that > is just a web site in a file directory. The project definitions from my > solution file are shown below if it helps. > > So I have been trying the following solution task (hopefully the > property names are descriptive enough): > > <solution configuration="${BuildConfig}" includevsfolders="true" > outputdir="${OutputRoot}\${BuildConfig}\${SolutionName}" > solutionfile="${SourceRoot}\${SolutionName}.sln" failonerror="true" > verbose="${VerboseOutput}"> > <assemblyfolders> > <include name="${ReferenceRoot}\${BuildConfig}" /> > </assemblyfolders> > <!-- > <webmap> > <map url="http://localhost/PMI/${SolutionName}.csproj" > path="${SourceRoot}\${SolutionName}\${SolutionName}.csproj" > casesensitive="false" /> > </webmap> > --> > </solution> > > I have tried with and without the webmap and I have tried a webmap who’s > URL was a file:// pointing to the website directory. I always get the > error: > > Error checking whether > 'C:\APS\PMI\Dev\RootNS.Web\RootNS.Web.Portal.UI.Search\PMI' is an > enterprise template project. > Access to the path > 'C:\APS\PMI\Dev\RootNS.Web\RootNS.Web.Portal.UI.Search\PMI' is denied. > > I don’t believe this “access denied” message, since I am running this as > a member of the local administrators group and this same code works fin > on all non-ASP.NET solutions. I am more inclined to believe that it is > looking for something it can’t find, but what? > > Am I just doing this entirely all wrong, or is there something subtle I > am missing? > > Thanks in advance. > > Tony > > <><><><> > > Microsoft Visual Studio Solution File, Format Version 9.00 > # Visual Studio 2005 > Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = > "RootNS.Web.Portal.UI.Search", > "RootNS.Web.Portal.UI.Search\RootNS.Web.Portal.UI.Search.csproj", > "{44D1F85A-FD4E-43AB-8F65-5CE212313F1B}" > ProjectSection(WebsiteProperties) = preProject > Debug.AspNetCompiler.Debug = "True" > Release.AspNetCompiler.Debug = "False" > EndProjectSection > EndProject > Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "C:\...\PMI\", > "RootNS.Web.Portal.UI.Search\PMI", "{1DDD45BD-976E-4EEE-B943-620724C1BA66}" > ProjectSection(WebsiteProperties) = preProject > Debug.AspNetCompiler.VirtualPath = "/PMI" > Debug.AspNetCompiler.PhysicalPath = > "RootNS.Web.Portal.UI.Search\PMI\" > Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\PMI\" > Debug.AspNetCompiler.Updateable = "true" > Debug.AspNetCompiler.ForceOverwrite = "true" > Debug.AspNetCompiler.FixedNames = "false" > Debug.AspNetCompiler.Debug = "True" > Release.AspNetCompiler.VirtualPath = "/PMI" > Release.AspNetCompiler.PhysicalPath = > "RootNS.Web.Portal.UI.Search\PMI\" > Release.AspNetCompiler.TargetPath = "PrecompiledWeb\PMI\" > Release.AspNetCompiler.Updateable = "true" > Release.AspNetCompiler.ForceOverwrite = "true" > Release.AspNetCompiler.FixedNames = "false" > Release.AspNetCompiler.Debug = "False" > VWDPort = "1939" > EndProjectSection > EndProject > > <><><><> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > NAnt-users mailing list > NAnt-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nant-users ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users