Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Command-line compile for asp.net

I have looked around and cannot seem to find an example of how to compile an asp.net solution with the command-line compliler. I mean, I know how to do it, but I'm getting errors about unknown references and other problems. I have tried including assemblies with /r:system.dll,system.web.dll, etc, but still no luck. Is there a simple way to do this?

Bill
Monday, May 19, 2003

Hmm, I've doing command line builds with no problem:

  csc /t:library whatever.cs

That spits out whatever.dll.  The easiest way to get the stuff in this DLL found is to place it in \bin under the web app root.

SomeBody
Monday, May 19, 2003

"I'm getting errors..." -- what errors?

Duncan Smart
Tuesday, May 20, 2003


The errors are all for stuff in other namespaces, for example

: error BC30002: Type 'DataRow' is not defined.
:error BC30451: Name 'MailFormat' is not defined.

The project compiles fine in the IDE. I'm assuming I need do some type of import for the namespace, with an option like /t:system.data.dll but that doesn't seem to help.

Bill
Tuesday, May 20, 2003

Aaaahh - you're using VB.NET right?

Looking at the ouput from "vbc /?"
...
/imports:<import_list> Declare global Imports for namespaces in referenced metadata files. import_list:namespace,...
...

VB has this ridiculous way of hiding what namespaces it's importing from you -- look at your project properties in VS.NET for the full list.

Duncan Smart
Tuesday, May 20, 2003

Thanks, Duncan. I overlooked that. Yet another reason for me to switch over to C#.

I'm still having issues getting all the files to compile properly. Is there a simple way to duplicate the Build Solution function in the IDE? For an app this small I like having it compiled into one assembly that I can move around, but it seems like with the command-line I have to have many small assemblies.

Bill
Wednesday, May 21, 2003

Answering my own question - seems like what I need to do is use devenv.exe with the right switches, that should build the whole solution for me.

Bill
Wednesday, May 21, 2003

Yes - do a "devenv /?"

Duncan Smart
Wednesday, May 21, 2003

Ok, got it working, put it in an Nant build file, and now I can build the app, test it with Nunit, and create a class help file with Ndoc in one click.

I think I got confused because Nant doesn't have a built in task for devenv, like it does for vbc or csc. Anyway, running it with the exec task seems to work fine.

Thanks Ducan!

Bill
Wednesday, May 21, 2003

Or, Thanks Duncan!

Bill
Wednesday, May 21, 2003

*  Recent Topics

*  Fog Creek Home