question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Security Exception

See original GitHub issue

Hi Developers

I’m developing two projects, one ASP.NET MVC and one Web API, both using Framework 4.5.2, nothing different from what we traditionally used in our projects. These common projects use Owin and the public on a server where it is set up as Medium Trust, send the error below:

Exception Details: System.Security.SecurityException: Request permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089' failed.

[SecurityException: Request permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089' failed.]
Microsoft.Owin.Host.SystemWeb.Infrastructure.DefaultTraceFactory.InitializeTraceSource (String) +0
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd (TKey key, Func`2 valueFactory) +62
Microsoft.Owin.Host.SystemWeb.Infrastructure.DefaultTraceFactory.GetOrAddTraceSource (String name) +52
Microsoft.Owin.Host.SystemWeb.Infrastructure.DefaultTraceFactory.Create (String name) +28
Microsoft.Owin.Host.SystemWeb.OwinAppContext..ctor () +43
Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build (Action`1 startup) +30
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint () +70
System.Threading.LazyInitializer.EnsureInitializedCore (T & target, Boolean & initialized, Object & syncLock, Func`1 valueFactory) +115
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init (HttpApplication Context) +106
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS (IntPtr appContext, HttpContext context, MethodInfo [] handlers) +534
System.Web.HttpApplication.InitSpecial (HttpApplicationState state, MethodInfo [] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance (intPtr appContext, HttpContext context) +339
System.Web.Hosting.PipelineRuntime.InitializeApplication (IntPtr appContext) +296

What I identified was at the same time, and use the Microsoft.Owin.Host.SystemWeb to hide this trust problem. What I know is also how libraries have the desired name The strong name and host on which an application is to run can not this type of configuration changed by company rules accounts (a company and a Locaweb). I have already tried to download the source and recompile, including System.Security.AllowPartiallyTrustedCallers but I have not yet succeeded.

Has anyone ever had the same problem and would know a way around it? Remembering that I can not have your Level Trust settings changed.

Thank you in advance! Raphael Cardoso

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ferronicardosocommented, Jun 14, 2017

Thanks, I’ll evaluate your suggestion.

1reaction
MaximRouillercommented, Jun 14, 2017

@ferronicardoso

If you are changing host, take the time to price and consider Azure. If you are hosting your clients, Elastic Pools allows you to share the load of multiple database over one pool of data with an easy migration path to a dedicated database.

Same thing can also be done with Multiple AppServices over Hosting Plan.

Can be a real cost saver.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Security Exception vs. Risk Acceptance
A security exception happens when you decide not to apply a certain internal cybersecurity policy based on functional or strategic factors.
Read more >
Security Exception vs. Risk Acceptance
Security exception : A condition that is not aligned with formal security expectations as defined by policy, standard, and/or procedure ...
Read more >
IT/Information Security Exception Request Process - Cal Poly
Provides a method for documenting an exception to compliance with established information technology and information security policies, standards, ...
Read more >
SecurityException Class (System.Security)
A SecurityException exception is thrown when a caller does not have the permissions required to access a resource. The following example instantiates a ......
Read more >
SecurityException (Java Platform SE 8 )
SecurityException. public SecurityException(String message, Throwable cause). Creates a SecurityException with the specified detail message and cause.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found