Z
Zeb
Hi all.
I've written a custom membership provider which works with tables in
my ms sql database. This works great locally, but as soon as I run the
site on the live (shared) server, I get the following error message:
Parser Error Message: Attempt to access the method failed.
The line in Web.Config that it's picked up on is as follows:
Line 29: <providers>
Line 30: <clear/>
Line 31: <add name="AspNetCustomMembershipProvider"
type="CustomMembershipProvider.CustomMembershipProvider"/>
Line 32: </providers>
Line 33: </membership>
I've discovered that overriding the standard MembershipProvider
requires Full Trust on the server and that one possible fix is to add
the following to the top of my CustomMembershipProvider:
[assembly: AllowPartiallyTrustedCallersAttribute()]
However, when I do this, although the solution builds okay, I get the
following error when I try to publish it:
Duplicate 'System.Security.AllowPartiallyTrustedCallersAttribute'
attribute
and it just points to a temporary file called App_Code.19.cs. I can't
see where else this has been used.
I've also played around with sn.exe to create a key and linked the
project to it in the hope this would help, but this hasn't made any
difference. I've asked my ISP if they can run the assemblies in Full
Trust mode, but I don't suspect they'll want to.
I've also read that I can use PermCalc to work out where the problem
is, although I don't seem to have the SDK, so I might download that
tonight and have a play.
Any other ideas to point me in the right direction would be very much
appreciated.
Thanks!
Matt
I've written a custom membership provider which works with tables in
my ms sql database. This works great locally, but as soon as I run the
site on the live (shared) server, I get the following error message:
Parser Error Message: Attempt to access the method failed.
The line in Web.Config that it's picked up on is as follows:
Line 29: <providers>
Line 30: <clear/>
Line 31: <add name="AspNetCustomMembershipProvider"
type="CustomMembershipProvider.CustomMembershipProvider"/>
Line 32: </providers>
Line 33: </membership>
I've discovered that overriding the standard MembershipProvider
requires Full Trust on the server and that one possible fix is to add
the following to the top of my CustomMembershipProvider:
[assembly: AllowPartiallyTrustedCallersAttribute()]
However, when I do this, although the solution builds okay, I get the
following error when I try to publish it:
Duplicate 'System.Security.AllowPartiallyTrustedCallersAttribute'
attribute
and it just points to a temporary file called App_Code.19.cs. I can't
see where else this has been used.
I've also played around with sn.exe to create a key and linked the
project to it in the hope this would help, but this hasn't made any
difference. I've asked my ISP if they can run the assemblies in Full
Trust mode, but I don't suspect they'll want to.
I've also read that I can use PermCalc to work out where the problem
is, although I don't seem to have the SDK, so I might download that
tonight and have a play.
Any other ideas to point me in the right direction would be very much
appreciated.
Thanks!
Matt