-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Medium trust
PostPosted: Thu Jan 19, 2006 7:50 am 
Newbie

Joined: Thu Jun 02, 2005 6:00 am
Posts: 12
Location: Ostrava, Czech Republic
Hi,
I ran into a problem recently. I need to run nHibernate App on shared hosting. However, CAS is there set on medium trust and app refuses to work. The error which I get is
Code:
SecurityException: That assembly does not allow partially trusted callers

Does anyone have any idea what to do to make it work?
I know, that it is necesarry to set [assembly: AllowPartiallyTrustedCallers()],
which I did, but I cannot do that in IesiCollections, hashCodeProvider and log4net (to which I donĀ“t have source).
That might be only part of the problem, but I would appreciate any help.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 19, 2006 8:25 am 
Newbie

Joined: Thu Jun 02, 2005 6:00 am
Posts: 12
Location: Ostrava, Czech Republic
My bad, I already found IesiCollections sources in nhibernate project and I changed them accordingly. But for Hash code provider, there is only IL code. Does anyone know how to add that attribute to IL and compile, or where to get modified hashcodeprovider?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 19, 2006 9:48 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I don't know the exact syntax, but try disassembling an assembly using Reflector or ILDASM and look at the output.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 21, 2006 9:44 am 
Newbie

Joined: Thu Jun 02, 2005 6:00 am
Posts: 12
Location: Ostrava, Czech Republic
Yeah, thanks for the tip, I already did it (decompiled HashCodeProvider - it was very siple piece of code...). The app now works fine with the [assembly: AllowPartiallyTrustedCallers()] set in assebmlyInfo. Almost everything works, except for proxies and IesiCollections.
I cannot make them work properly. I experience problems with ISet - I had to replace it with IList (bag instaed of set) and proxying doesnt work at all too. It has some problem getting KeyPair in Castle.DynamicProxy.Builder.CodeGenerators. Maybe I did bad job while building it...
I will test it more. If anyone has similar problems, and does know of any fixture, please, let me know.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 6:51 am 
Beginner
Beginner

Joined: Thu Oct 20, 2005 9:26 am
Posts: 27
Location: Barcelona
I have this problem as well, but can't recompile NHibernate.

I get this error:
Cryptographic failure while signing assembly 'D:\data\development\nhibernate 1.0.2\src\NHibernate\obj\Debug\NHibernate.dll' -- 'Error reading key file '..\NHibernate.snk' -- The system cannot find the file specified. '

How did you get past that?
And generally, did you get it to work with Medium Trust?
My host has the same limitation :(

/David Givoni


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 6:53 am 
Beginner
Beginner

Joined: Thu Oct 20, 2005 9:26 am
Posts: 27
Location: Barcelona
found the problem and solution described here (to the snk-file missing):

http://wiki.nhibernate.org/display/NH/P ... SF+Release

/David


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.