473,322 Members | 1,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

C# Compiling Question

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

Nov 17 '06 #1
5 1314
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?

Nov 17 '06 #2
Hi,

Just out of curiosity, what value would that provide?

--
Dave Sexton

"NvrBst" <qu****@hotmail.comwrote in message
news:11*********************@f16g2000cwb.googlegro ups.com...
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

Nov 17 '06 #3
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.

Nov 18 '06 #4
>AL.exe wasn't able to do it.
No, but the C++ linker (link.exe) can.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 18 '06 #5
No, but the C++ linker (link.exe) can.

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

Nov 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Maurice LING | last post by:
Hi, I remembered reading a MSc thesis about compiling Perl to Java bytecodes (as in java class files). At least, it seems that someone had compiled scheme to java class files quite successfully....
11
by: Arturo DiDonna | last post by:
Hello everyone. I am trying to compile someone else code and I am stuck with compilation problems using the g++ 3.3 compiler. Basically, when compiling the following code, I get this error...
3
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody have a problem compiling some solution in VS2003? I get the error every time that some files are locked and are using by another process. I repeat compiling again and again...
2
by: Justin Naidl | last post by:
A group of friends and I are doing a RPG (role-playing game) maker for a school project. It occured to us, however, that if you want the user to be able to have almost complete control over the...
1
by: Ben Fidge | last post by:
Can anyone shed some light on why compiling and running web-apps is so slow in VS2005. I have a solution with 3 web-apps, 20 or so library projects and several winforms apps. All in all it totals...
0
by: phoolimin | last post by:
Dear all, I am trying to embed python into another scripting language, to do this I need to solve a number of problems on importing or compiling python script. First let me state what exactly I...
5
by: skumar434 | last post by:
Hi everybody, I am faceing problem with strings. The code is given bellow .In this program i am tring to copy data from a file into structure . I am able to copy the data ,but the dat is...
21
by: onkar | last post by:
#include<stdio.h> int i; int i; int main(){ printf("i=%d\n",i); return 0; } Note : I am using gcc-3.4.3 on i386-redhat-linux
4
by: Dean Slindee | last post by:
I have a project with many References to other projects of mine (data access layer projects, for instance). When I compile a data access layer project, the Reference in the parent project goes...
9
by: bowlderyu | last post by:
Hello, all. I meet a question about compiling files. Eg., I have three files named myfile.h, myfile.c and the main.c file, and there is a function, ex, void myfun(...). If I put myfun(...) in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.