New Posts New Posts RSS Feed: xbap accessible entities
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

xbap accessible entities

 Post Reply Post Reply
Author
ruven View Drop Down
Newbie
Newbie
Avatar

Joined: 27-Nov-2010
Location: South Africa
Posts: 1
Post Options Post Options   Quote ruven Quote  Post ReplyReply Direct Link To This Post Topic: xbap accessible entities
    Posted: 27-Nov-2010 at 10:42am

A simple solution that works is:

Add the following line to the webconfig

...

<trust level="Full" legacyCasModel="true" />

...

</system.web>

Regards,

www.dilowa.co.za

Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 18-May-2010 at 5:19pm

This MSDN link talks about creating XBAPs in .NET 4 and how to create a Full-Trust XBAP:

 
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 18-May-2010 at 7:19am

I added  [assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)] to the DomainModel Assembly.cs file as well as the xbap app Assembly.cs file. This causes a new issue:

The type initializer for 'LOC.AMP.Data.DomainModel.EntityManager' threw an exception. which is thrown at the Login method of my LoginClientCore class.
 
INNER Exception:
Request failed
Stack:
   at LOC.AMP.Data.DomainModel.EntityManager..cctor()
Method:
'((System.Security.SecurityException)(((System.Exception)($exception)).InnerException)).Method' threw an exception of type 'System.Security.SecurityException'
PermissionState:
'((System.Security.SecurityException)(((System.Exception)($exception)).InnerException)).PermissionState' threw an exception of type 'System.Security.SecurityException'
PermissionType:
{Name = "PermissionSet" FullName = "System.Security.PermissionSet"}
PermitOnlyInstance:
'((System.Security.SecurityException)(((System.Exception)($exception)).InnerException)).PermitOnlySetInstance' threw an exception of type 'System.Security.SecurityException'
RefusedSet:
'((System.Security.SecurityException)(((System.Exception)($exception)).InnerException)).RefusedSet' threw an exception of type 'System.Security.SecurityException'
Zone:
System.Security.SecurityZone.MyComputer
'((System.Security.SecurityException)(((System.Exception)($exception)).InnerException)).Url' threw an exception of type 'System.Security.SecurityException'
 
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 17-May-2010 at 8:25pm

I did some poking around and .NET 4 has a lot of changes to partially trusted assemblies and code access security. 

Try searching for:
"Inheritance security rules violated by type" .net 4
and
"Derived types must either match the security accessibility of the base type or be less accessible" .net 4
 
Many of the discussions point to adding this attribute to your assembly:
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
 
There's some other suggestions there that might be worth trying as well.  Let us know what you find.
 
 
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 17-May-2010 at 5:18pm
"Inheritance security rules violated by type: 'LOC.AMP.Data.DomainModel.BaseEntity'. Derived types must either match the security accessibility of the base type or be less accessible.":"LOC.AMP.Data.DomainModel.BaseEntity"
 
Stack:
   at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimePropertyInfo.get_Signature()
   at System.Reflection.RuntimePropertyInfo.get_PropertyType()
   at MS.Internal.Data.PropertyPathWorker.GetInfo(Int32 k, Object item, SourceValueState& svs)
   at MS.Internal.Data.PropertyPathWorker.ReplaceItem(Int32 k, Object newO, Object parent)
   at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.AttachDataItem()
   at System.Windows.Data.BindingExpression.Activate(Object item)
   at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
   at System.Windows.Data.BindingExpression.AttachOverride(DependencyObject target, DependencyProperty dp)
   at System.Windows.Data.BindingExpressionBase.Attach(DependencyObject target, DependencyProperty dp)
   at System.Windows.Data.BindingExpressionBase.OnAttach(DependencyObject d, DependencyProperty dp)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
 

    [DataContract]

    [KnownType(typeof(BaseEntity))]

    public partial class BaseEntity : IbEm.Entity, IDXDataErrorInfo

    {

       

....}



Edited by orcities - 17-May-2010 at 5:20pm
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 17-May-2010 at 5:12pm
Nope:
 

[DataContract]

[KnownType(typeof(BaseEntity))]

public partial class BaseEntity : IbEm.Entity, IDXDataErrorInfo

{

Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 17-May-2010 at 5:11pm
Do you have an injected base class that is not public?  That's the only thing I can think of that would cause that message.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 14-May-2010 at 1:50pm
I am trying to make my project xbap accessible as well as windows accessible. When I do I get the following error:
 
Inheritance security rules violated by type: 'LOC.AMP.Data.DomainModel.BaseEntity'. Derived types must either match the security accessibility of the base type or be less accessible.
 
I am assuming web does not have the same permission. Suggestions on how to work with this?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down