Hi everyone,

To build a NAnt build using this precompiler, we obviously have to know
what the precompiler is called and where it resides. It resides in the
.Net system folder itself, which for my version of .Net 2.0 is located
at c:/windows/Microsoft.NET/Framework/v2.0.50727 (note this could be
different after some future upgrade of .Net).  The name of the
precompiler program itself is aspnet_compiler.exe.

Unfortunately, the world is not so nice as You described :(

A word about references is in place here. In Asp.net 2.0, there are four types of referenced assemblies: 1. Assemblies in GAC, the reference description goes into web.config file. No worries during build :) 2. Assemblies in /bin folder of site. Every assembly there is automatically referenced in code. in nicest case, there is an assemblyname.dll.refresh file in bin folder, so You can figure out where to find the updated one. 3. If the web site contains project references, the ONLY place where the update information can be obtained is the solution file. Without the solution file, these references can not be distinguished from... 4. Assemblies without any update information - any assembly just copied into /bin directory.

Why am I talking about this? Because aspnet_compiler does not update any file in the /bin folder. It must be done prior calling it. And do update project references You must start parsing the *.sln file :(

My way (temporary) is to just call msbuild.exe with appropriate solution file as parameter.. MSBuild takes care of updateing the references...

And the Visual Studio 2005 builds asp.net sites into "WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" folder... Probably not exactly same output as with command line pre-compiling, but who cares :-P


I have a plain vanilla class library (i.e. dll) project I need to build,
but it has one web reference.  In VS.2003, adding a web reference just
caused VS.2003 to automagically generate the source code, which it put
into a file named Reference.cs. But in VS.2005, Reference.cs is no
longer generated, nor is any other source file I can find. So I have not
yet figured out how to NAnt build this project because I get compiler
errors due to the missing code (the stuff that used to be in
Reference.cs). If you can tell me the incantations for this bit of black
magic, please let me know.

We have several projects with web references, and all of them have references.cs file generated... You must have something wrong in Your solution. Couple of things too look at: 1. does the references.map file have "Custom Tool" set? (Should be MSDiscoCodeGenerator) 2. If You right click on references.map (Solution explorer) and choose "Run custom tool", does it give You any errors or warnings?


--
Gert

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to