471,336 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

Building .NET 3.0

I recently installed the .NET 3.0 framework (behind the time, I know), and
am seeing an issue building it.

Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
things. Since the assemblies added in 3.0 aren't in the 2.0 directory tree,
their names need to be fully qualified, so I wind up with command lines
like:

csc /r:"c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windo ws Communication
Foundation"\System.Runtime.Serialization.dll ParseXml.cs

Did I miss some way to simplify this, or is that just how it works?

Jun 27 '08 #1
11 1197
Just a small correction about your question: it doesn't relate to
"building", it relates to "compiling". Building is taken care of by
msbuild.exe and is a different than compiling.

As for your compiling, are you using a version of Visual Studio? If so, you
shouldn't have to do any command line work.


"Mike Schilling" <ms*************@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>I recently installed the .NET 3.0 framework (behind the time, I know), and
am seeing an issue building it.

Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
things. Since the assemblies added in 3.0 aren't in the 2.0 directory
tree, their names need to be fully qualified, so I wind up with command
lines like:

csc /r:"c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windo ws Communication
Foundation"\System.Runtime.Serialization.dll ParseXml.cs

Did I miss some way to simplify this, or is that just how it works?

Jun 27 '08 #2
On May 12, 11:58*am, "Mike Schilling" <mscottschill...@hotmail.com>
wrote:
I recently installed the .NET 3.0 framework (behind the time, I know), and
am seeing an issue building it.

Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
things. *Since the assemblies added in 3.0 aren't in the 2.0 directory tree,
their names need to be fully qualified, so I wind up with command lines
like:

csc /r:"c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windo ws Communication
Foundation"\System.Runtime.Serialization.dll ParseXml.cs

Did I miss some way to simplify this, or is that just how it works?
Out of curiosity, why don't you simply install 2008 express?
Jun 27 '08 #3
Ignacio Machin ( .NET/ C# MVP ) wrote:
On May 12, 11:58 am, "Mike Schilling" <mscottschill...@hotmail.com>
wrote:
>I recently installed the .NET 3.0 framework (behind the time, I
know), and am seeing an issue building it.

Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to
build things. Since the assemblies added in 3.0 aren't in the 2.0
directory tree, their names need to be fully qualified, so I wind up
with command lines like:

csc /r:"c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windo ws Communication
Foundation"\System.Runtime.Serialization.dll ParseXml.cs

Did I miss some way to simplify this, or is that just how it works?

Out of curiosity, why don't you simply install 2008 express?
We have a mixed environment, of which .NET is only a fraction, and thus our
build environment is command-line driven rather than .NET-centric. Nor do I
want to have to install and maintain VS.NET on headless machines used only
to do builds.

Anyway, that all aside, is there a way to simplify these command lines, or
do the assembly names have to be fully qualified?
Jun 27 '08 #4
Mike Schilling <ms*************@hotmail.comwrote:
Out of curiosity, why don't you simply install 2008 express?

We have a mixed environment, of which .NET is only a fraction, and thus our
build environment is command-line driven rather than .NET-centric. Nor do I
want to have to install and maintain VS.NET on headless machines used only
to do builds.
So use MSBuild - create project/solution files with Visual Studio, and
just run MSBuild on those and let it deal with everything.
Anyway, that all aside, is there a way to simplify these command lines, or
do the assembly names have to be fully qualified?
You could add the references to the default response list for csc.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #5
Mike Schilling wrote:
I recently installed the .NET 3.0 framework (behind the time, I know), and
am seeing an issue building it.

Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
things. Since the assemblies added in 3.0 aren't in the 2.0 directory tree,
their names need to be fully qualified, so I wind up with command lines
like:

csc /r:"c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windo ws Communication
Foundation"\System.Runtime.Serialization.dll ParseXml.cs

Did I miss some way to simplify this, or is that just how it works?
msbuild, Csc task, AdditionalLibPaths + References attributes

or

nant, csc task, references nested element and ant style fileset

Arne
Jun 27 '08 #6
Jon Skeet [C# MVP] wrote:
Mike Schilling <ms*************@hotmail.comwrote:
>>Out of curiosity, why don't you simply install 2008 express?

We have a mixed environment, of which .NET is only a fraction, and
thus our build environment is command-line driven rather than
.NET-centric. Nor do I want to have to install and maintain VS.NET
on headless machines used only to do builds.

So use MSBuild - create project/solution files with Visual Studio, and
just run MSBuild on those and let it deal with everything.
Does MSBuild integrate well with Ant? That's what drives the build (Ant has
build-in tasks to run csc, ilasm, etc.)
>
>Anyway, that all aside, is there a way to simplify these command
lines, or do the assembly names have to be fully qualified?

You could add the references to the default response list for csc.
Aha! And how do I do that?
Jun 27 '08 #7
Mike Schilling <ms*************@hotmail.comwrote:
So use MSBuild - create project/solution files with Visual Studio, and
just run MSBuild on those and let it deal with everything.

Does MSBuild integrate well with Ant? That's what drives the build (Ant has
build-in tasks to run csc, ilasm, etc.)
There's an MSBuild task in the Ant .NET library:
http://ant.apache.org/antlibs/dotnet/

Alternatively just execute it with exec task.
Anyway, that all aside, is there a way to simplify these command
lines, or do the assembly names have to be fully qualified?
You could add the references to the default response list for csc.

Aha! And how do I do that?
Find csc.rsp in your framework directory and edit it. It's not a
terribly nice way of doing it though - running MSBuild would be much
better.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #8
Mike Schilling wrote:
Jon Skeet [C# MVP] wrote:
>Mike Schilling <ms*************@hotmail.comwrote:
>>>Out of curiosity, why don't you simply install 2008 express?
We have a mixed environment, of which .NET is only a fraction, and
thus our build environment is command-line driven rather than
.NET-centric. Nor do I want to have to install and maintain VS.NET
on headless machines used only to do builds.
So use MSBuild - create project/solution files with Visual Studio, and
just run MSBuild on those and let it deal with everything.

Does MSBuild integrate well with Ant? That's what drives the build (Ant has
build-in tasks to run csc, ilasm, etc.)
I would find it tempting to use nant because:
- nant supports everything you will need
- the nant syntax is so close to ant that it will be easy to use

Arne
Jun 27 '08 #9
Arne Vajhøj wrote:
Mike Schilling wrote:
>Jon Skeet [C# MVP] wrote:
>>Mike Schilling <ms*************@hotmail.comwrote:
Out of curiosity, why don't you simply install 2008 express?
We have a mixed environment, of which .NET is only a fraction,
and
thus our build environment is command-line driven rather than
.NET-centric. Nor do I want to have to install and maintain
VS.NET
on headless machines used only to do builds.
So use MSBuild - create project/solution files with Visual Studio,
and just run MSBuild on those and let it deal with everything.

Does MSBuild integrate well with Ant? That's what drives the build
(Ant has build-in tasks to run csc, ilasm, etc.)

I would find it tempting to use nant because:
- nant supports everything you will need
As I said above, .NET is a fraction of the entire build. Ant does a
fine job of running command-line programs, and I suspect nant does a
poor one of invoking the Java compiler within its active JVM.,
Jun 27 '08 #10
Hi Mike,

Because csc doesn't automatically resolve references to GAC assemblies than
using DOS variables can be the way. For instance, folllowing example simplifying
your input just to use the variables:

@set net20path=%windir%\Microsoft.NET\Framework\v2.0.50 727
@set net30path=%windir%\Microsoft.NET\Framework\v3.0
@set net30wcfpath=%net30path%\Windows Communication Foundation
@set csc=%net20path%\csc.exe

@set refserialization=%net30wcfpath%\System.Runtime.Ser ialization.dll

%csc% /r:"%refserialization%" ParseXml.cs

Regards, Alex
[TechBlog] http://devkids.blogspot.com

MSI recently installed the .NET 3.0 framework (behind the time, I
MSknow), and am seeing an issue building it.
MS>
MSBecause 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to
MSbuild things. Since the assemblies added in 3.0 aren't in the 2.0
MSdirectory tree, their names need to be fully qualified, so I wind up
MSwith command lines like:
MS>
MScsc /r:"c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windo ws
MSCommunication Foundation"\System.Runtime.Serialization.dll
MSParseXml.cs
MS>
MSDid I miss some way to simplify this, or is that just how it works?
MS>
Jun 27 '08 #11
Mike Schilling wrote:
Arne Vajhøj wrote:
>Mike Schilling wrote:
>>Jon Skeet [C# MVP] wrote:
Mike Schilling <ms*************@hotmail.comwrote:
>Out of curiosity, why don't you simply install 2008 express?
We have a mixed environment, of which .NET is only a fraction,
and
thus our build environment is command-line driven rather than
.NET-centric. Nor do I want to have to install and maintain
VS.NET
on headless machines used only to do builds.
So use MSBuild - create project/solution files with Visual Studio,
and just run MSBuild on those and let it deal with everything.
Does MSBuild integrate well with Ant? That's what drives the build
(Ant has build-in tasks to run csc, ilasm, etc.)
I would find it tempting to use nant because:
- nant supports everything you will need
As I said above, .NET is a fraction of the entire build. Ant does a
fine job of running command-line programs, and I suspect nant does a
poor one of invoking the Java compiler within its active JVM.,
True, but you can call nant from ant !!

Arne
Jun 27 '08 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by DrSarang | last post: by
1 post views Thread by Kelly B. | last post: by
17 posts views Thread by Nick | last post: by
3 posts views Thread by thomson | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.