Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

binding to an unsigned assembly outside the appbase

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
janekw - 29 Jun 2006 10:20 GMT
...is this possible? Can you perchance provide an entry in the config
file which would allow such behaviour?

I think it should be possible at least on the local machine, you can
always copy those unsigned assemblies to a subfolder of your app, so
it's not like it's a security feat.

Thanks for any help,
Jan
janekw - 29 Jun 2006 10:33 GMT
It's a bit wierd anyhow. I've loaded an assembly into my domain using
LoadFrom() function; then when I want to deserialize an object of a
class from this assembly, I get those binding errors. Isn't the
required assembly already loaded? Why bind, then? The only option I
know of is to copy the assembly file somewhere into appbase. Isn't
there another way (apart from singing the assembly)

Jan
Vadym Stetsyak - 29 Jun 2006 16:15 GMT
Hello, janekw!

j> I think it should be possible at least on the local machine, you can
j> always copy those unsigned assemblies to a subfolder of your app, so
j> it's not like it's a security feat.

You can provide codebase path, where loader can find assemblies.
( http://msdn2.microsoft.com/en-us/library/efs781xb.aspx )

For more details on how Runtime loads and binds assemblies look at
( http://msdn2.microsoft.com/en-us/library/yx7xezcf.aspx )

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
janekw - 30 Jun 2006 09:38 GMT
Hello, Vadym

> You can provide codebase path, where loader can find assemblies.
> ( http://msdn2.microsoft.com/en-us/library/efs781xb.aspx )

First of all it's no use to me because I'd have to know the identity of
each of those libraries in advance, i.e. before runtime, and I know
only a folder name. But you couldn't have known that, of course:)
Anyway, "codebase" won't work with unsigned assemblies outside the
appbase - either you sign the assembly or copy it somewhere below your
app's root folder.

Thanks for reply,
Jan
Vadym Stetsyak - 30 Jun 2006 10:11 GMT
Hello, janekw!

 j> First of all it's no use to me because I'd have to know the identity of
j> each of those libraries in advance, i.e. before runtime, and I know
j> only a folder name. But you couldn't have known that, of course:)
j> Anyway, "codebase" won't work with unsigned assemblies outside the
j> appbase - either you sign the assembly or copy it somewhere below your
j> app's root folder.

Why? If you know assembly names, with the help of config settings
you can do the redirection. Or I'm missing something here?

Or if you do not know their names then you can use Assembly.LoadFile(...) to load assemblies.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
janekw - 02 Jul 2006 13:30 GMT
> Why? If you know assembly names, with the help of config settings
> you can do the redirection. Or I'm missing something here?

I don't know their names, but even if I knew, I'd have to sign all of
them to do the redirection, because they are located outside my app's
root folder. Too much trouble.

> Or if you do not know their names then you can use Assembly.LoadFile(...) to load assemblies.

Exactly. I load them at startup using this function. But it's not
enough for automatic deserialization. I've mentioned it in my second
post but let me be more specific:

Let's say those assemblies contains definitions of serializable classes
B, C, D and all of them derive from (also serializable) class A , which
I know and I have it's assembly "statically" linked to my project. At
runtime, after I LoadFile() B, C, D, I can dynamically (i.e. by
reflection) create these instances. I can also serialize the objects.
But in turn when I want to deserialize them, I get binding errors to
assemblies with B, C, D.

So, you know the situation. I can copy those assmeblies into a
subfolder on my app, so it's not a critical problem. I just wonder if
you can solve this in more elegant fashion:)

Jan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.