Wie deaktivieren System.Sicherheit.Die Berechtigungen.ReflectionPermission Verwendung in neue VS2013 Asp.net Vorlage so funktioniert es auf shared-hosting

Ich erstellt eine neue Visual Studio 2013 ASp.net MVC-Anwendung aus der Standard-MVC-Vorlage. Jedoch bin ich immer eine Fehlermeldung Anforderung für die Berechtigung des Typs " System.Sicherheit.Die Berechtigungen.ReflectionPermission gescheitert.

Ist es möglich, schalten Sie diese Reflexion Erlaubnis, damit die Website funktioniert immer noch?

hier ist mein web.config

<?xml version="1.0" encoding="utf-8"?>
    <!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=301880
    -->
    <configuration>
    <configSections>

      <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    </configSections>
    <connectionStrings>
      <add name="MyDb" connectionString="Data Source=x.x.com;Initial Catalog=x;User Id=x;Password=x;" providerName="System.Data.SqlClient" />
    </connectionStrings>
    <appSettings>
      <add key="webpages:Version" value="3.0.0.0" />
      <add key="webpages:Enabled" value="false" />
      <add key="ClientValidationEnabled" value="true" />
      <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    </appSettings>
    <system.web>
    <trust level="Full" />
      <customErrors mode="Off"/>
      <authentication mode="None" />
      <compilation targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>
    <system.webServer>
      <modules>
        <remove name="FormsAuthenticationModule" />
      </modules>
    </system.webServer>
    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
          <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
          <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
        </dependentAssembly>
        <dependentAssembly>
          <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
          <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
        </dependentAssembly>
        <dependentAssembly>
          <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
          <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
        </dependentAssembly>
        <dependentAssembly>
          <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
          <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
        </dependentAssembly>
        <dependentAssembly>
          <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
          <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
        </dependentAssembly>
      </assemblyBinding>
    </runtime>
    <entityFramework>
      <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameters>
          <parameter value="v11.0" />
        </parameters>
      </defaultConnectionFactory>
      <providers>
        <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      </providers>
    </entityFramework>
    </configuration>

Exception Details: System.Sicherheit.SecurityException: Anforderung für die Berechtigung des Typs " System.Sicherheit.Die Berechtigungen.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

[SecurityException: Anforderung für die Berechtigung des Typs >' - System.Sicherheit.Die Berechtigungen.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Delegieren.DelegateConstruct(Object target, IntPtr slot) +0
Owin.Loader.DefaultLoader..ctor(Func3 next, Func2-Aktivator, IEnumerable1 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

Habe ich versucht, hinzuzufügen

<trust level="Full" />

meinem Web.Config system.Web-Abschnitt, aber das hat nicht funktioniert, da bekam ich einen

Dieser Konfigurationsabschnitt kann nicht verwendet werden, auf diesem Weg. Dies geschieht, wenn der site-administrator gesperrt hat Zugang zu diesem Abschnitt mit Hilfe von einer geerbten Konfigurationsdatei.

ist es shared-hosting an 1and1.com und Sie wird nicht geben Sie mir voll Vertrauen.

InformationsquelleAutor greay | 2013-10-21

Schreibe einen Kommentar