126 messaggi dal 05 agosto 2013
Finalmente avevo finito la mia web-application con visual studio 2017.
usando "Pubblica" direttamente da vs2017 ho fatto l'upload della soluzione.
Ma subito sono nati i problemi:
1°) voleva la seguente modifica in web.config: <customErrors mode="Off"/>
2°) ho messo <trust level="Full" /> sempre in web.config

Ora mi segnala:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.

Source Error:

Come posso fare per pubblicare correttamente lam ia web-app?
11.886 messaggi dal 09 febbraio 2002
Contributi
Ciao, se stai pubblicando su Aruba leggi qui:
https://forum.aspitalia.com/forum/post/415266/Sito-Asp.net-MVC5-Trasferimento-Aruba.aspx?PageIndex=1
https://forum.aspitalia.com/forum/post/418208/Pubblicazione-Progetto-Visual-Studio-2017-15.4.aspx



1°) voleva la seguente modifica in web.config: <customErrors mode="Off"/>

Credo che si stesse verificando un errore e aggiungendo <customErrors mode="Off" /> hai fatto in modo che venissero mostrati tutti i dettagli di quell'errore. Postalo qui, altrimenti non è possibile sapere come risolvere il problema.


2°) ho messo <trust level="Full" /> sempre in web.config

L'hosting provider probabilmente ti impedisce di elevare il livello di trust a "Full". Questo spiegherebbe perché hai l'errore:

This happens when the site administrator has locked access to this section


Se sei su Aruba, devi richiedere che la tua applicazione venga spostata su un server in Full trust. Ti faranno firmare un foglio. Ecco qui un'altra discussione in cui si parla di questo:
https://forum.aspitalia.com/forum/post/413538/Security-Exception-Sito-Web-Hosting-Condiviso.aspx

ciao,
Moreno

Enjoy learning and just keep making
126 messaggi dal 05 agosto 2013
Ho tolto dalla web.config il mark relativo al trust. ora l'errore che mi dà è il seguente:

To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.


Ho notato che nela compilaione prima della pubblicazione usando Visual Studio ci sono riferimenti a RosLin. Ma non saprei dirti dove.
provo a pubblicare l'intera mia web.config, caso mai tu ci vedi qualcosa che possa modificare per risolvere il problema rimanendo in medium trust (che nn so manco cosa voglia dire)

<?xml version="1.0" encoding="utf-8"?>
<!--
  Per altre informazioni su come configurare l'applicazione ASP.NET, vedere
 https://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-xxxxxx.mdf;Initial Catalog=aspnet-xxxxxx;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <customErrors mode="Off" />
    <authentication mode="None" />
    <compilation strict="false" explicit="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" />
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization" />
      </namespaces>
      <controls>
        <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
      </controls>
    </pages>
    <membership>
      <providers>
        <!--
        L'appartenenza ASP.NET è disabilitata in questo modello. Per informazioni sul supporto dell'appartenenza ASP.NET in questo modello, vedere https://go.microsoft.com/fwlink/?LinkId=301889
        -->
        <clear />
      </providers>
    </membership>
    <profile>
      <providers>
        <!--
        Il profilo di appartenenza ASP.NET è disabilitato in questo modello. Per informazioni sul supporto dell'appartenenza ASP.NET in questo modello, vedere https://go.microsoft.com/fwlink/?LinkId=301889
        -->
        <clear />
      </providers>
    </profile>
    <roleManager>
      <!--
          Il ruolo di appartenenza ASP.NET è disabilitato in questo modello. Per informazioni sul supporto dell'appartenenza ASP.NET in questo modello, vedere https://go.microsoft.com/fwlink/?LinkId=301889
        -->
      <providers>
        <clear />
      </providers>
    </roleManager>
    <!--
            Se si esegue la distribuzione a un ambiente cloud che include più istanze del server Web,
            è necessario modificare la modalità stato sessione da ""InProc"" a ""Custom"". È inoltre necessario
            modificare la stringa di connessione ""DefaultConnection"" per la connessione a un'istanza
            di SQL Server (inclusi SQL Azure ed SQL  Compact) anziché a SQL Server Express.
      -->
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthentication" />
      <remove name="ApplicationInsightsWebTracking" />
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.OAuth" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.Cookies" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
    </compilers>
  </system.codedom>
  <system.net>
    <mailSettings>
      <smtp from="utente@fastwebnet.it">
        <network host="smtp.fastwebnet.it" port="587" enableSsl="true" userName="utente" password="password" />
      </smtp>
    </mailSettings>
  </system.net>
</configuration>
<!--ProjectGuid: CD8E53D2-B177-494B-AE08-1CEEF98E43D7-->
11.886 messaggi dal 09 febbraio 2002
Contributi
Ciao, prova a togliere l'elemento system.codedom, cioè questo:
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
    </compilers>
  </system.codedom>


Inoltre, se non usi Application Insights (o se non sai cos'è), togli anche questa parte.
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />

e togli anche questa:
<httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>



medium trust (che nn so manco cosa voglia dire)

E' una tecnica obsoleta e sconsigliata da Microsoft che gli hosting provider si ostinano a usare per assicurarsi che un'applicazione non faccia danni a livello di sistema e non interferisca con altre applicazioni situate sullo stesso server.
In pratica, in regime di medium trust non ti viene dato il permesso di fare alcune cose, come hai avuto modo di constatare. Comunque, risolti questi problemi, alcuni utenti hanno detto che sono riusciti a far funzionare la loro applicazione. Altri hanno rinunciato prima e semplicemente si sono fatti spostare lo spazio su un server con full trust.

ciao,
Moreno

Enjoy learning and just keep making
126 messaggi dal 05 agosto 2013
Premesso che httpmodule non c'è nel web.config, dopo i tuoi suggeriementi, il messaggio di errore è:

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.ReflectionPermission, 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.  


Posso fare altro, prima di chiedere il full trust?
11.886 messaggi dal 09 febbraio 2002
Contributi
Ciao, sì, puoi provare a rimuovere gli action link dalla view _Layout.cshtml. Cioè dovresti provare a sostituire questi link generati così:
<ul class="nav navbar-nav">
  <li>@Html.ActionLink("Home", "Index", "Home")</li>
  <li>@Html.ActionLink("Chi siamo", "About", "Home")</li>
  <li>@Html.ActionLink("Contatti", "Contact", "Home")</li>
</ul>

Nelle loro controparti statiche
<ul class="nav navbar-nav">
  <li><a href="/">Home</a></li>
  <li><a href="/Home/About">Chi siamo</a></li>
  <li><a href="/Home/Contact">Contatti</a></li>
</ul>


Però forse ti conviene passare al full trust.
Questa soluzione arriva da qui, dove un utente ha avuto il tuo stesso identico problema.
https://forum.aspitalia.com/forum/post/419115/Problema-Hello-World-Publish.aspx?pageIndex=2
In quel caso si trattava veramente di un progetto minimale, quindi non so se nel tuo caso, che magari hai un progetto molto più avanzato, valga la pena di mettersi a modificare tutti i link.

ciao,
Moreno

Enjoy learning and just keep making
333 messaggi dal 05 novembre 2012
Però forse ti conviene passare al full trust.


concordo...nel progetto utilizza owin (propabilmente per asp identity)

/Ciao

Alessio
126 messaggi dal 05 agosto 2013
Continua la telenovela. Dopo aver firmato il modulo di accettazione delle regole per il full trust non ancora riesco a vedere operativo il sito.
Ora segnala il seguente errore
This operation requires IIS integrated pipeline mode. 
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.PlatformNotSupportedException: This operation requires IIS integrated pipeline mode.

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.  



Ho lavorato tanto per pubblicare il sito in tempi utili, ed ora sono circa 10 giorni che aruba mi sta bloccando per tutta una serie di errori. UFFAAAA
Potete darmi qualche dritta?

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.