Deploying ASP.NET MVC4 App to GoDaddy Compiler issue

前端 未结 6 1230
无人及你
无人及你 2020-11-30 22:59

Have seen several posts about deploying MVC apps to GoDaddy. None of them seem to address the issue we are having. We have followed the advice about checking runtime versio

相关标签:
6条回答
  • 2020-11-30 23:24

    I removed the Roslyn nuget package like explained in the link below, but it's a workarround.

    https://social.msdn.microsoft.com/Forums/en-US/442b100a-2b88-4ac4-b655-0c1345791f15/roslyn-cscexe-web-api-2-on-hosting-server?forum=msbuild

    This problem happens with a clean mvc 5 web project from visual studio 2015 template. I contacted the godaddy support, let's see what they do.

    0 讨论(0)
  • 2020-11-30 23:26

    I have struggled with the same problem for months. And finally solved it. In the plesk on godaddy I changed the ASP.Net settings. First changed CAS-trustlevel to Full. Then I changed in the Web.config of my project the following:

    • Add trust level full to the system.web
    • Remove the compilers in the system.codecom
     <system.web>
        compilation debug="true" targetFramework="4.5.2"/>
        <httpRuntime targetFramework="4.5.2"/>
        <trust level="Full"/>             <!-- Just add this to the webconfig -->
     </system.web>
    
     <system.codedom>
                  <!-- All is removed between the 2 tags-->
     </system.codedom>
    

    and that solved my problem.

    0 讨论(0)
  • 2020-11-30 23:29

    Excellent. I also have same problem. However, my hosting vendor is arvixe.

    1. Add >trust level="Full" />" under >system.web> section in Web.config
    2. comment out >compilers> section of the >codedom> in Web.config

    The problem Fixed!!!

    0 讨论(0)
  • 2020-11-30 23:40

    I had same issue on GoDaddy hosting.

    To fix it follow these steps.

    Step 1: Choose "Precompile during publish" in Web Deploy settings.

    Step 2: <trust level="Full" /> in <system.web> in Web.config

    0 讨论(0)
  • 2020-11-30 23:41

    csc.exe compiler error after publish

    comment below on web.config

    <!--<compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.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.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>-->
    
    0 讨论(0)
  • 2020-11-30 23:48

    You have to remove the compilation info from the web config and it will work.

    In addition to precompiling (check the box in your publish settings), add the following to your Web.Release.config:

    <system.web>
      <trust level="Full" xdt:Transform="Insert" />
    </system.web>
    <system.codedom xdt:Transform="Remove" /> <!-- No compiling on server, GoDaddy blocks it. -->
    

    UPDATE (1/27/2017): It appears (at least on my account) that removing system.codedom is no longer required.

    0 讨论(0)
提交回复
热议问题