PC Review


Reply
Thread Tools Rate Thread

How to compile a single file

 
 
LP
Guest
Posts: n/a
 
      30th Jul 2003
Hi,
I have a site which runs on .Net technology. The site is
already deployed and running. I need to change 1 file for
some small enhancement. Please tell me, how can I compile
that 1 file and merge it to the original DLL (the one
deployed on the live server) so as to upgrade it. I dont
want to recompile the whole project for the 1 file

Regards,.
LP
 
Reply With Quote
 
 
 
 
sandman
Guest
Posts: n/a
 
      30th Jul 2003
You can build the one library by selecting it in the
Solution Explorer window and then either pressing Ctrl-F7
or select it off the Build Menu. It should show as a
separate menu item (i.e. Build MyLib as opposed to Build
Solution). That's the closest I've found to a limited
build.

>-----Original Message-----
>Hi,
>I have a site which runs on .Net technology. The site is
>already deployed and running. I need to change 1 file for
>some small enhancement. Please tell me, how can I compile
>that 1 file and merge it to the original DLL (the one
>deployed on the live server) so as to upgrade it. I dont
>want to recompile the whole project for the 1 file
>
>Regards,.
>LP
>.
>

 
Reply With Quote
 
Richard Grimes [MVP]
Guest
Posts: n/a
 
      10th Sep 2003
C# and VB.NET have no concept of 'linking' object files, so if a single
source file changes in your project then all the source files for the
assembly have to be rebuilt. I guess Microsoft took this approach to make
building an assembly a simpler procedure than the two step compile and link
that occurs with C++.

Managed C++ does have the concept of linking, so you compile C++ source
files to .obj files (with cl.exe) and then link them (with link.exe) to get
the assembly. If one source file changes and the .obj's for the other source
files exist then building the assembly only involves compiling the single
source file and linking together the .obj's.

Neither .NET, nor Win32, have a concept of 'merge [a compiled source file]
to the original DLL, to upgrade it'. The reason is that when the assembly is
built the compiler creates a hash value of the module and any modules it
uses and these are place in the assembly manifest. When the assembly is
loaded these hashes are created again and compared to the stored values to
see if the assembly has been tampered with.

The actual process is not quite that simple, because if you have a multi
module file modules are only loaded when the types in them are specifically
requested. In fact, you can use this as a way to get round your problem. If
you put the code for the types that are likely to change into a .NET module,
you can recompile this at a later stage and copy it into your app directory
to replace the old version. However, this will only work for assemblies that
have not been signed. Once you sign an assembly (provide a
[AssemblyKeyFile]) the hash for the module is checked when it is loaded, and
so if you replace it with another version the hash will be different and a
FileLoadException will be thrown.

Richard
--
my email (E-Mail Removed) is encrypted with ROT13 (www.rot13.org)

"LP" <(E-Mail Removed)> wrote in message
news:0acb01c3568a$84e08c90$(E-Mail Removed)...
> Hi,
> I have a site which runs on .Net technology. The site is
> already deployed and running. I need to change 1 file for
> some small enhancement. Please tell me, how can I compile
> that 1 file and merge it to the original DLL (the one
> deployed on the live server) so as to upgrade it. I dont
> want to recompile the whole project for the 1 file
>
> Regards,.
> LP



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile and debug a single .cs in IDE? Afshar Microsoft C# .NET 2 22nd Jun 2006 06:51 AM
Single source code to compile over .NET 1.0, 1.1, 2.0 and CF Vipul Pathak Microsoft Dot NET Framework 2 11th Mar 2006 10:53 AM
Single source code to compile over .NET 1.0, 1.1, 2.0 and CF Vipul Pathak Microsoft Dot NET 2 11th Mar 2006 10:53 AM
How can I compile controls to a single DLL? chambersdon@hotmail.com Microsoft Dot NET Framework 4 30th Jun 2005 08:50 PM
Compile C# and MC++ into a single DLL Brian Donovan-Smith Microsoft VC .NET 0 12th Jul 2003 11:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 PM.