I've created an asp.net Web Forms site with Visual Studio 2013. Scripts and pages are generated automatically by VS 2013. The problem is that the website doesn't work with the .Net trust level "Medium". It reqires "Full" level.
With the "Medium" Level it throws an error:
The application attempted to perform an operation not allowed by the security policy. To grantthis application the required permission please contact your system administrator or change the application's trust level in the configuration file.
[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Delegate.DelegateConstruct(Object target, IntPtr slot) +0
Owin.Loader.DefaultLoader..ctor(Func`3 next, Func`2 activator, IEnumerable`1 referencedAssemblies) +69
Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +65
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +28
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) +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
I understand that the issue is related to the IIS trust level.
My questions are
Is there a way around to make the website work with trust level "Medium". The reason is that my host sharing server doesn't allow Full trust.
How to trace the script that is causing this error behavior.
Thank you in advance....