System.MissingMemberException : Public member 'DenyGetRoles' on type 'RolesForType' not found.

System.MissingMemberException : Public member 'DenyGetRoles' on type 'RolesForType' not found.

Old forum URL: forums.lhotka.net/forums/t/6527.aspx


Mousty posted on Friday, February 27, 2009

I am currently experiencing this error with the framework itself while running the unit tests for the recommended (gray) version of 3.5:

Test.AppContext.AppContextTests.SimpleTest:
System.MissingMemberException : Public member 'DenyGetRoles' on type 'RolesForType' not found.

There are variations with AllowGetRoles etc...  Overall, most of my unit tests are failing for this permission reason.

Could someone hint me in the right direction?  Is it a bad config file? Missing file?

Mousty replied on Friday, February 27, 2009

Hum, strange.. if I make those members public, it seems to go through.

Test.DataPortal.DataPortalTests.CallDataPortalOverrides:
DataPortalException : DataPortal.Create failed ()
  ----> System.Reflection.AmbiguousMatchException : Overload resolution failed because no Public 'CallMethod' can be called with these arguments:
    'Public Shared Function CallMethod(obj As System.Object, info As System.Reflection.MethodInfo, ParamArray parameters As System.Object()) As System.Object':
        Argument matching parameter 'info' cannot convert from 'DynamicMethodHandle' to 'MethodInfo'.
    'Public Shared Function CallMethod(obj As System.Object, method As String, ParamArray parameters As System.Object()) As System.Object':
        Argument matching parameter 'method' cannot convert from 'DynamicMethodHandle' to 'String'.

RockfordLhotka replied on Friday, February 27, 2009

If you are somehow running in partial trust then private reflection wouldn't work. Perhaps your tests aren't running in fulltrust?

Copyright (c) Marimer LLC