9 messaggi dal 28 ottobre 2017
Ho provato un minimo progetto Asp.Net vuoto con un WebForForm, logicamente in locale tutto ok, i guai iniziano testando ilprogetgto su Hosting Windows (Aruba, supporta Asp.Net 4.5)

Ho pubblicato il progetto su una cartella e quindi trasferita su web.

Fino ad un paio di versioni fa VS2017 non c'erano problemi con l'Hosting Aruba, bastava il file webform1,aspx e relativo .cs

 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: The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.

Source File: D:\inetpub\webs\efalcoit\testweb5\web.config    Line: 14 


<?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>
  <system.web>
    <compilation debug="true" targetFramework="4.6.1"/>
    <httpRuntime targetFramework="4.6.1"/>
    <customErrors mode="Off"/>
  </system.web>
  <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>
</configuration>


la riga incriminata e'
  <compiler language="c#;cs;csharp" extension=".cs"
 


la struttura e'
<dominio>
/TestWeb
/bin
rosyln
Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
WebApplication1.dll
WebApplication1.pdb

il file Microsoft.CodeDom... e' presente, non riesco a capire perche' non trova il file.
11.886 messaggi dal 09 febbraio 2002
Contributi
Ciao,
assicurati di aver installato la corretta versione del pacchetto NuGet. Nel tuo web.config leggo 1.0.8.0 ma poi di fatto l'applicazione cerca la versione 1.0.7.0.

Hai due possibili soluzioni:

Inoltre, leggi questa discussione:
http://forum.aspitalia.com/forum/post/415266/Sito-Asp.net-MVC5-Trasferimento-Aruba.aspx?PageIndex=1
Se anche riuscissi a risolvere il problema, è possibile che tu ottenga una SecurityException dato che, su Aruba, il sito gira per default in regime di Medium Trust.

Dovrai rinunciare a Roslyn oppure chiedere ad Aruba di abilitarti i privilegi Full Trust (credo che ti faranno firmare un'assunzione di responsabilità).

ciao,
Moreno

Enjoy learning and just keep making
9 messaggi dal 28 ottobre 2017
Ho installato la rel 1.0.7 Microsoft.CodeDom.Providers.DotNetCompilerPlatform, e modificato il web.config per avere un accesso non Full Trust

Ora mi da errore su questa riga , la 14; VS non segnala come errata questa configurazione, l'Hosting Aruba si.

  </securityPolicy>


a meno che non manchi il file
"web_mediumtrust.config"


presente su C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config, ma dovrebbe essere presente nell'Hosting.


Questo l'errore
Server Error in '/' Application.
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: The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.

Source Error:

An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.


Source File: D:\inetpub\webs\efalcoit\test5\web.config    Line: 14

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2106.0 


<?xml version="1.0"?>
<!--
  Per altre informazioni su come configurare l'applicazione ASP.NET, vedere
 https://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation debug="false" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <customErrors mode="Off"/>
    <securityPolicy>
     <!-- <trustLevel name="Medium" policyFile="internal"/> -->
     <trustLevel name="Medium"  policyFile="web_mediumtrust.config"/>
    </securityPolicy>   <!-- linea 14 -->
   </system.web>  
 
 
   <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /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.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>


Non segnala problemi di restrizioni di accesso, quanto a "roslyn", ho fatt oun test disintallando
- Microsoft.CodeDom.Providers.DotNetCompilerPlatform
- Microsoft.NetCompiler

Web.config variato
<?xml version="1.0"?>
<!--
  Per altre informazioni su come configurare l'applicazione ASP.NET, vedere
 https://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation debug="false" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <customErrors mode="Off"/>
    <securityPolicy>
     <!-- <trustLevel name="Medium" policyFile="internal"/> -->
     <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
    </securityPolicy>
   </system.web>
</configuration>


ma stesso errore

Avere un livello Full Trust non credo sia la soluzione a tutto, ci sara' pure qualche WebApp che gira su aruba in Medium Trust, il problema deve essere altro.
11.886 messaggi dal 09 febbraio 2002
Contributi
Ciao,


Avere un livello Full Trust non credo sia la soluzione a tutto, ci sara' pure qualche WebApp che gira su aruba in Medium Trust, il problema deve essere altro.

Al momento siamo ancora fermi un passo prima.
Prima di preoccuparci del Full/Medium trust dobbiamo avere una configurazione valida.
L'errore da risolvere è il seguente:


The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.


Proviamo ad usare la seconda soluzione che ti suggerivo nel post precedente: installa il pacchetto 1.0.8.0 e poi configura un binding redirect in modo che quando l'applicazione cerca l'assembly versione 1.0.7.0 (o successive) venga reindirizzata alla versione 1.0.8.0.

Prova così:
<?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>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <customErrors mode="Off"/>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.8.0" newVersion="1.0.8.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.8.0" newVersion="1.0.8.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <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>
</configuration>



Oppure:

ho fatto un test disintallando ... ma stesso errore

Se vuoi provare a disinstallare roslyn devi anche disinstallare i relativi pacchetti. Assicurati che quando ripubblichi il sito non siano rimaste le dll di Roslyn nello spazio web su Aruba.



<trustLevel name="Medium" policyFile="web_mediumtrust.config"/>

Questo va tolto.

ciao,
Moreno

Enjoy learning and just keep making
9 messaggi dal 28 ottobre 2017
L'errore persiste sia settando Asp.Net come Claasix che Integrated
ho messo nello spazio Hosting Web.config, Webform1.apsx Weboform1.aspx.cs e la cartella bin

Ho fatto come hai scritto, installato la 1.0.8 e modificato il web.config

ho modificato questa riga
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>


cosi, in quanto visual studio non compilava, segnalando errore nei doppi apici "Web"
warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>


provando ad ignorare questo l'errore
Origine di configurazione:

   38:         type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
   39:         warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
   40:       </compilers>


ottengo errore alla riga 34
<compiler language="c#;cs;csharp" extension=".cs"


questo il web.config
<!--
  Per altre informazioni su come configurare l'applicazione ASP.NET, vedere
 https://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <!--
    Per una descrizione delle modifiche al file web.config, vedere il sito Web all'indirizzo http://go.microsoft.com/fwlink/?LinkId=235367.

    Gli attributi seguenti possono essere impostati sul tag <httpRuntime>.
      <system.Web>
        <httpRuntime targetFramework="4.5" />
      </system.Web>
  -->
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <customErrors mode="Off"/>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.8.0" newVersion="1.0.8.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.8.0" newVersion="1.0.8.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <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>
</configuration>


Errore
 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: The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.

Source Error:


An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.


Source File: D:\inetpub\webs\efalcoit\testweb5\web.config    Line: 34

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2106.0 
11.886 messaggi dal 09 febbraio 2002
Contributi
Non so quale potrebbe essere il problema dato che quel web.config non ha dentro niente di particolare. A parte Roslyn, che abbiamo già detto dovrebbe darti una SecurityException se il sito gira in medium trust.

Fai così: crea un nuovo progetto ASP.NET vuoto da Visual Studio. Aggiungi una webForm Default.aspx, giusto per avere una pagina. Pubblica il progetto in una cartella locale e poi trasferisci il contenuto via FTP nello spazio web di Aruba. Se va in errore, senti che ti dicono dall'assistenza.

ciao,
Moreno

Enjoy learning and just keep making
11.886 messaggi dal 09 febbraio 2002
Contributi
Altra cosa: vedo che la versione del framework nel server è la 4.7. Prova anche tu ad utilizzare la stessa versione per compilare la tua applicazione al posto della 4.5 che stai usando ora. Gli elementi compilation e httpRuntime del web.config vanno modificati di conseguenza (ma li trovi già aggiornati se, come ti dicevo prima, crei un nuovo progetto da Visual Studio selezionando il framework 4.7)

Ma tu sei in hosting condiviso o hai la tua macchina virtuale?
Modificato da BrightSoul il 05 novembre 2017 17.21 -

Enjoy learning and just keep making
9 messaggi dal 28 ottobre 2017
Risposta di Aruba

Gentile Cliente, in questo caso l'utente deve configurare la cartella che contiene il progetto come Application, tramite programmi Microsoft: IIS Manager collegandosi al webserver. Lo staff di Aruba ha comunque configurato la cartella ed ora il messaggio a video indicatoci non risulta presente, tuttavia risulta presente altro aller che indica che l'applicazione deve girare in ambiente Full Trust.

Ora compare il messaggio di security, ho dato indicazioni per passare a FullTrust; aggiorno sui risultati.

[SecurityException: Request failed.]
   System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +96
   System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +80
   System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +288
   System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, RuntimeAssembly asm, SecurityAction action) +70
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
   System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +40
   System.Type.GetType(String typeName) +30
   System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid() +12
   System.Web.Compilation.CompilationUtil.GetRecompilationHash(CompilationSection ps) +2045
   System.Web.Configuration.CompilationSection.get_RecompilationHash() +107
   System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDateInternal(Int64 cachedHash) +458
   System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(Int64 cachedHash) +51
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

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.