-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: spark
Message 10 in Discussion

"You could create netmodules rather than exes or dlls with appropriate codebases, and 
link them into your assembly with the assembly linker tool. Then, you distribute your 
assembly, and let the netmodules be available at a public location. " Sir, what do you 
mean by this one - ok i got as far as my netmodule, but where is the public location 
that i am expected to put my netmodule ? the only refernce i found with a basic search 
is :
Deploying a Runtime Application Using Internet Explorer
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondeployingcommonlanguageruntimeapplicationusingie55.asp
now this borders on no touch deployment does it not ? this too didnt say much :
Locating the Assembly through Codebases or Probing
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstep4locatingassemblythroughcodebasesorprobing.asp
 further the <codebase> element in the config file does not seem to work with 
netmodules (actually it deosnt say that it will work with netmodules also. This has to 
be a web path does it, local paths arent allowed ? <snip>
if you are not familiar with netmodules - it is one step into creating a a multifile 
assembly :
say i have this :
 //netmod.cs
 using System;
 public class netmod{
  public void display(string abc){Console.WriteLine(abc);}
 }
and this : 
 //app.cs
 using System;
 class App{
  static void Main(){
   netmod n = new netmod();
   n.display("hello world");
  }
 } 
now 
csc /t:module netmod.cs 
 - will generate my netmodule netmod.netmodule, this is a module and not an assembly - 
it is a part of a multifile assembly. Remember i released teh metadata viewer a few 
days back, try this
trashbin netmod.netmodule /mdtab
 - notice the differences in the metadata tables. Most notable thing you will find is 
that in the tables list RID= 32, Table 'Assembly' doesnt exist. :) indicating that it 
is not a full assembly. there is a however a 'AssemblyRef' to mscorlib. now compile 
app.cs to make a exe (which is a single assembly) that spans accross two files, like 
this
csc /addmodule:netmod.netmodule app.cs
 - this will create app.exe that will depend on the netmod.netmodule to work.
If you ask trashbin to dump metadata info on app.exe you will find the (32) Assembly 
table as well as the 'File' table with one entry that refers to 'netmod.netmodule'.
trashbin app.exe /mdtab /md:Strings
( trashbin : http://www27.brinkster.com/sparksite/work/trashbin/trashbin.htm ) 
actually you dont neet trashbin - double click on the manifest entry in idasm: it 
gives you a much more readble IL version of the info in these tables.
</snip> 
"Assembly.LoadFrom allows you to load an assembly from a remote machine. Load it into 
the current application domain, probably by supplying an AssemblyResolver 
(AppDomain.AssemblyResolver), and you are set. "
Yes, thanks for this i got this to work - 'like a charm' <snip>
this is what i did :
//loadfrom.cs
//compile : csc loadfrom.cs 
using System;
using System.Reflection;
class Test
{
 static void Main(string[] argv) {
  Assembly asm = Assembly.LoadFrom(argv[0]);
  foreach(Type t in asm.GetTypes())
   foreach(MethodInfo mi in t.GetMethods())
    Console.WriteLine("\t{0}::{1}()",t,mi.Name);
 }
}
this will generate loadfrom.exe
The following work pretty well
 loadfrom test.dll
  - local dll load
 loadfrom \\computer\sharedfolder\test.dll
  - over a shared drive
 loadfrom http://localhost/test.dll
  - over the web
are there any other scenarios that i can LoadFrom ?
</snip> "If you are hardcore about using remoting in some form, AppDomain.Load allows 
you to load an assmbly given a Byte array containing a COFF image of an assembly. You 
could send a serialized version of an assembly file over remoting, and use 
AppDomain.Load to load that in."
I am not trying this, but i am sure this will work - in this case, the actual jod of 
transporting the code on the wire will be my responsibilty right? "Now, the Ek Crore 
Ka question. Why?"
Iskeliye mujhe phone-a-friend karna padega...  actually close, i got mailed by a 
friend - asking me if this could be done and i simply didnt have an answer, nothing in 
remoting i knew could move code across the wire and every other alternative seemed 
like i had to do it by 'hand'. The LoadFronm is rather cool, can you drop me a little 
more explanation on the netmodules approach. ?
That is the answer to why beacuse as of right now I am not packing this into any app. 
Actually this was teh document and it seemed like the RMI approach to this was a very 
clean ...
http://java.sun.com/docs/books/tutorial/rmi/server.html
<snip>
package compute; import java.io.Serializable; public interface Task extends 
Serializable {
    Object execute();
}
...
Different kinds of tasks can be run by a Compute object as long as they are 
implementations of the Task type. The classes that implement this interface can 
contain any data needed for the computation of the task and any other methods needed 
for the computation. 
</snip>
except that the name fangling that moving around the byte code does, doesnt cause any 
remote execution - as you said.  urelated:
btw that night's talk about yasser shohoud, did get us thinking about WS after ~1.5 
years odd. havent really followed up on it yet but i found this in a don box blog that 
you might like this (nothing very core)(,also nice to know that dbox 
squeaks(www.squeak.org)):
The problem with slashdot (not the noise channel)
part 1,2 and 3
http://www.douglasp.com/2003/05/12.html#a284
http://www.douglasp.com/2003/05/13.html#a288
http://www.douglasp.com/2003/05/13.html#a291 thanks
 rosh

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to