Actually, I tried that. The Location property of an in-memory assembly is
the Empty string.
I even tried to get the assemblies from the AppDomain like this:
foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
{
string loc = asm.Location;
parameters.ReferencedAssemblies.Add(loc);
}
In this case it "almost" work. The code actually compiled. However, when I
tried to run the code I got the following exception:
Error: unexpected exception: File or assembly name kygy0xbi, or one of its
dependencies, was not found.
which I "assume" is my previosly generated assembly that it compiled
against. the name is different each time which is why I think it must be
the referenced in memory assembly.
So at this point I'm not sure if this is the right approach. If it is, I'm
not sure what to do to work around the fact it can't find it after it
compiles against it...
Ray
[quoted text, click to view] "Sankar Nemani" <snemani@nospamlumedx.com> wrote in message
news:#JEkzv35DHA.1636@TK2MSFTNGP12.phx.gbl...
> I've had a similar problem. I am trying to compile an assembly that
> references another assembly that is downloaded during a smartclient run.
> I have a theory that "may" work.
> All assemblies including the in-memory ones do reside on the disk. The
> in-memory assemblies may reside in some temp location. You can find out
the
> location of any such assembly using the Location property of the assembly
> class.
> Once you have the location property you can use that path when you add
> assembly references using the parameters.ReferencedAssemblies.Add method.
>
> Lemme know if it worked.
> Sankar
>
>
> "Ray Johnson" <rayj@ingenio.com> wrote in message
> news:#4jJDA35DHA.2252@TK2MSFTNGP10.phx.gbl...
> >
> > I'm trying to compile an assembly in memory (kind of a plugin thing)
that
> > references another assembly in memory.
> >
> > Unfortunantly, the CompilerOptions object only has an argument like
this:
> > parameters.ReferencedAssemblies.Add("System.DLL");
> >
> > where the assembly must be on disk.
> >
> >
> >
> > Is there a way to reference an assembly that is only in memory?
> >
> >
> >
> > Ray
> >
> >
>
>