0
votes

I've just published my LS app to my host (WinHost) and I used the publish settings provided by my host and setup the database, etc. And when I go to my website address (where the app is located), I get the following page:

Server Error in '/MyAPP' Application.

Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

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

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
Microsoft.LightSwitch.BaseServices.Logging.Utilities.HostEnvironment.RunningInAzureCore() +0 Microsoft.LightSwitch.BaseServices.Logging.Utilities.HostEnvironment.RunningInAzure() +108 Microsoft.LightSwitch.BaseServices.Logging.Utilities.HostEnvironment.get_IsEncryptionRequired() +24 Microsoft.LightSwitch.WebHost.Implementation.LightSwitchHttpModule.Init(HttpApplication application) +21
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045


Now, I have made sure that my server is using .NET 4. I have checked that the credentials are correct, many times. The app debugs fine. Just not after I've uploaded it.

What gives? I understand that it says "SecurityException and Access Denied, etc" - but what the hell does that actually mean when everything i've entered is OK?

2

2 Answers

0
votes

You may want to check the Application on the web server. Make sure that the application pool and application are running under the correct permission levels for the type of application.

It can be a bit tricky, but typically you will get an error inside the application if there are bad credentials to the database or authentication of the user. If the application itself fails, there may be a permissions issue inside IIS.

0
votes

Check the trust level for your application. Go to your application, and click on the .NET trust level, and change it to FULL