473,748 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Micr osoft.NET\Frame work\v2.0.50727 \Csc.exe /noconfig
/unsafe- /nowarn:1701,170 2 ....
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 1323
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.netmodu le
Make Another Modual (Everything Else) = everythingelse. netmodule

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

csc.exe /Addmodule:mycla ss.netmodule
/Addmodule:every thingelse.netmo dule myProgram.cs

And I can just keep changing "myclass.netmod ule" 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:mycla ss.netmodule" to it... I'll try tomorrow, but would
it still be possible to combine the 2 files (.exe and
myclass.netmodu le) 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******** *************@f 16g2000cwb.goog legroups.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\Micr osoft.NET\Frame work\v2.0.50727 \Csc.exe /noconfig
/unsafe- /nowarn:1701,170 2 ....
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.mainmetho d" 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 ("Cleanlines s 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.netmod ule" 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
3451
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. I'm wondering if something of such had been attempted in python, as in compiling X language into .pyc. I do not understand the schematics of .pyc files but I assume that they are the so called python bytecode files. Or is there any...
11
3202
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 message: parsefcns.cc: In function `void get_token(std::ifstream*, char**)': parsefcns.cc:57: error: cannot convert `std::basic_string<char, std::char_traits<char>, std::allocator<char> >' to `char*' in assignment make: *** Error 1
3
4985
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 and finally the compilation can be finished successfully after several tries. What can be a reason of that? I turned off my antivirus software, no results. Maybe it's just a bug of the VS2003? I installed the latest service pack for the Studio...
2
1960
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 contents of his/her game, that you would end up with a tiny executable and a huge datafile. We wanted to keep clear of this as disk accesses take a lot of time to do and there would be a huge load of them to do this part. We could very easily...
1
1754
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 about 150,000 lines of C#. I've only just converted this to VS2005 project but am frustrated with the following: - VS2005 insists on compiling all projects when I press F5 to run an application even though no code has changed in the other...
0
1457
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 want to do, that is, I want the following syntax to be supported in the host language which I am developing: ###################################################### # scripts in the host language
5
1915
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 needed to run some commands ,as u can see i have a string which has the command. The command is---- chicmd debug 0xB701 0x000000ce3 0xAABBCCDD
21
1668
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
1396
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 stale (yellow icon) when the parent project is concurrently open (two VS instances). I have been manually deleting the stale Reference and re-adding the Reference in the concurrently open parent project. Is this manual process necessary, or will...
9
1585
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 the main.c file like the following, ..... void myfun(...) {
0
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9332
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.