Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

C# Compiling Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NvrBst - 17 Nov 2006 10:48 GMT
I'm wondering if this is possible... Basically say I have a lot of .cs
files but only 1 of them changes.  Is there a way (with the csc.exe, or
VS.NET 2005, or another C# Compiler), that I can compile everything
before hand, keep the object files of the unchanged .cs files, and just
compile the 1 file I edit and somehow link it with my exsisting object
files?

IE in C++, all the .cpp files compiled to .o files.  And you can keep
all the .o files and only update the .o file that you are working with
and link them at the end instead of compiling the entire project again.

Basically when I compile with VS.NET 2005 (if its after a "Clean
Solution" or After I already compiled and just changed 1 file, it seems
to always call the same line in the "Build Output", namely

------ Build started: Project: MyProject, Configuration: Debug Any CPU
------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig
/unsafe- /nowarn:1701,1702  ....

I also see that a "\obj\Debug\" with a bunch of ".resources" and
".cashe" files are kept but I'm not sure how to use these (if at all
possible?) with the csc.exe if I only change 1 .cs file.  The # of
files here are a lot less than the amount of .cs files I have.  And I'd
like to see it manually (see what the csc.exe (or such) that its
calling with the obj\Debug\ files).

Is this at all possible with C#?  Thanks

NB
NvrBst - 17 Nov 2006 12:16 GMT
I found it I think... I have to use modules.  So basically I have it
like this...

Make 1 Modual (The class 1 Change Consantly) = myclass.netmodule
Make Another Modual (Everything Else) = everythingelse.netmodule

then I just have myProgram.cs (with my main() in it) and call

csc.exe /Addmodule:myclass.netmodule
/Addmodule:everythingelse.netmodule myProgram.cs

And I can just keep changing "myclass.netmodule" and not have to
re-compile the "everythingelse.netmodule".

But... Before I only had 1 .exe (it was cleaner).  Now I have the exe
with 2 .netmodules that have to go with it else it wont run.  I'll look
tomorrow after some sleep but is there a way to make them all into 1
.exe (AL.exe perhaps?).

PS. Now that I think about it I can probably just change the
"everythingelse.netmodule" to "/t=winexe" and add the
"/Addmodule:myclass.netmodule" to it...  I'll try tomorrow, but would
it still be possible to combine the 2 files (.exe and
myclass.netmodule) after they both are created?
Dave Sexton - 17 Nov 2006 12:35 GMT
Hi,

Just out of curiosity, what value would that provide?

Signature

Dave Sexton

> I'm wondering if this is possible... Basically say I have a lot of .cs
> files but only 1 of them changes.  Is there a way (with the csc.exe, or
[quoted text clipped - 26 lines]
>
> NB
NvrBst - 18 Nov 2006 00:29 GMT
AL.exe wasn't able to do it.  I made "everythingelse.module" and
"myclass.module" then called AL.exe with the
"/main:namespace.class.mainmethod" but it still needed all 3 files to
run.

:)  Having 2 or 3 files isn't that big a deal with me, it was a
cleanliness value ("Cleanliness is next to Godliness").  Having a
single exe to hand out to people is harder for them to mess up, or for
example I keep a bunch of single programs in 1 folder, if I/someone
wanted to delete this one after a while they'd need to remember that
"mycalss.netmodule" was part of this exe.  A folder with 2 files in it
is almost not worth it.
Mattias Sjögren - 18 Nov 2006 00:52 GMT
>AL.exe wasn't able to do it.

No, but the C++ linker (link.exe) can.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

NvrBst - 18 Nov 2006 06:20 GMT
> No, but the C++ linker (link.exe) can.

Ahh your right :)  Many thanks, its the way I wanted it now.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.