Site works on localhost, but not on UolHost (permissions?)

1

I created a default site (from those that already come pre-encoded from visual studio 2013), using asp.net mvc technology with common authentication for individual accounts.

In my localhost the site runs that it is a beauty, it registers users, I check in the database and everything is perfect.

But when I publish to the host uol, at the time of logging in with a registered user, it gives permission problem (print: link )

I do not think it's necessary to have full trust to run such a basic application, otherwise it would not be possible to host asp.net mvc on almost any commercial server. It should be some configuration (it does not work if I set trust level = full in webconfig because the uol host does not allow this change).

I've tried everything you can think of, but I still have not been able to get it to work.

Has anyone had this problem before and can you give me a light?

Error description:

  

Server Error in '/' Application.

     

Attempt by security transparent method 'System.Security.Claims.ClaimsIdentity.AddClaim (System.Security.Claims.Claim)'. failed.

     

Assembly 'Microsoft.AspNet.Identity.Core, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' is partially trusted, which causes the CLR to make it entirely transparent regardless of any transparency annotations in the assembly itself . In order to access security critical code, this assembly must be fully trusted.

     

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

     

Exception Details: System.MethodAccessException: 'System.MethodAccessException: Attempt by security transparent method'. System.Security.Claims.ClaimsIdentity.AddClaim (System.Security.Claims.ClaimsIdentityFactory'1 + d__0.MoveNext (). Security.Claims.Claim) 'failed.

     

Assembly 'Microsoft.AspNet.Identity.Core, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' is partially trusted, which causes the CLR to make it entirely transparent regardless of any transparency annotations in the assembly itself . In order to access security critical code, this assembly must be fully trusted.

    
asked by anonymous 23.11.2014 / 18:24

2 answers

1

Try adding the code below to your web.config

<system.webServer> <modules runAllManagedModulesForAllRequests="true" /> </system.webServer>

I've had a similar problem and this code solved my problem.

    
19.06.2015 / 15:48
0

You can try adding the configuration below in your web.config, inside the System.web tag:

<trust level="medium" originUrl="" />

But this may not work on some hosts because they block this setting.

It's hard to test.

    
23.11.2014 / 20:03