none
Roslyn CSC.exe, Web API 2 on Hosting Server

    Question

  • Hi there, I have been searching high and low for a solution to my challenge. I have recently upgraded to Visual Studio 2015, and I am using .NET Framework 4.5.2 for my Web API 2 project. I have done web api related projects previously on VS 2013, and everything works fine on the hosting environment. I am using GoDaddy.

    Problem:

    When I compiled and uploaded my web api project files to the hosting server, it tells me that there is a group policy error for executing the CSC.exe file within the Bin\roslyn\ folder.

    In VS 2013, when we compile our projects, there is no such folder for "roslyn".

    I have tried to read up about Roslyn but that doesn't seem to help me with my situation.

    Is there anyway can disable roslyn in my project? I desperately need a solution to this problem.

    Note: I am using a shared hosting environment. All my past projects have no issues (done with VS 2013).


    • Edited by CryoWerx Sunday, July 26, 2015 7:01 AM edit text
    Sunday, July 26, 2015 7:01 AM

All replies

  • Hello,

    >>When I compiled and uploaded my web api project files to the hosting server, it tells me that there is a group policy error for executing the CSC.exe file within the Bin\roslyn\ folder

    According to your description, the third party hosting server throw this group policy with the upgraded project. Have you tried a new project created in VS 2015 and can it throw error again? I would recommend you put your question on third party hosting server support channel.

    Feel free to le me know if you have any concerns.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 27, 2015 9:18 AM
  • I also encountered this issue using Visual Studio Community with GoDaddy hosting. I was able to work around it by uninstalling the Roslyn package from my project. It's this package:

    https://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform

    I haven't yet determined if there's any drawbacks to uninstalling it, but when I published the application to GoDaddy I no longer got the group policy error and everything appears to be working fine.

    I don't know enough about the new platform to know if there's a hit from uninstalling it, but at least it's now working on GoDaddy. Here's more info that I'm continuing to read:

    http://blogs.msdn.com/b/webdev/archive/2014/05/12/enabling-the-net-compiler-platform-roslyn-in-asp-net-applications.aspx

    Best of luck.

    • Proposed as answer by Alan650 Wednesday, June 21, 2017 3:34 AM
    Tuesday, August 11, 2015 10:21 AM
  • I have noticed a minor drawback to uninstalling this package:

    https://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform

    Some of the new C# 6.0 language features if used in Views (MVC project) will not compile.  Many of my views use the   ?.    null checking operator for accessing Model properties.  All of these views now return errors on my Godaddy hosted MVC 5 application.

    This error occurs because Views (by default) are compiled at runtime using the .NET pipeline (not pre-compiled).

    To resolve this issue, simply uncheck the "Allow precompiled site to be updatable" option in your publish profile settings.  This should pre-compile your views and allow your C# 6.0 (Latest version of Roslyn Compiler) to run like a champ.

    • Proposed as answer by Arni Leibovits Tuesday, August 16, 2016 7:36 PM
    Thursday, September 24, 2015 8:21 PM
  • This absolutely did the trick. Perfect!

    -Thanks

    Monday, September 28, 2015 9:34 PM
  • awesome!!! spent half a day on this, you are the only one with a valid solution!!!!
    Wednesday, September 30, 2015 11:46 AM
  • After 2 days, search ended on your answer. thanks dear.
    Monday, October 19, 2015 1:23 AM
  • Somehow, in godaddy's "shared" server hosting, I still get the "group policy" vieolation security issue. :(

    Could pre-compiling the web app fix the issue? 'haven't tried it, 'just thought to ask anyways, maybe some people will know.

    Tx

    Friday, October 23, 2015 10:27 PM
  • Worked like a charm! Saved me from having to upgrade to "private hosting", as per GoDaddy tech support.

    

    Tuesday, November 10, 2015 6:43 PM
  • Nailed it, thanks!  
    Wednesday, December 02, 2015 7:29 PM
  • Hi,

    I am getting same issue while deploying on GoDaddy. Do I need to uninstall Roslyn?

    Monday, March 07, 2016 5:48 AM
  • Hi,

    I am getting same issue while deploying on GoDaddy. Do I need to uninstall Roslyn?

     I did it and worked like a charm!
    Sunday, June 26, 2016 11:47 AM
  • I follow the same steps, but now when I navigate to site/api/apicontrollername I am getting 500 error.. whereas on local IIS server its work without any error.. 
    Saturday, February 25, 2017 4:56 AM
  • csc.exe compiler error after publish

    comment below in 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>-->
    Friday, April 07, 2017 3:51 PM
  • Thank you much for the tip!

    After my hours and calls to Go Daddy Support

    A simple check mark does the trick

    Saturday, April 29, 2017 1:14 PM
  • Great question and this site seems to be the only one with the correct answer.
    Wednesday, June 21, 2017 3:34 AM
  • thanks
    Monday, July 03, 2017 1:29 PM
  • I tried but its still the same
    Monday, July 03, 2017 7:01 PM
  • yes they are asking to upgrade to private hosting. I unchecked the "Allow precompiled site to be updatable" option in my publish profile settings. but still the same error
    Monday, July 03, 2017 7:27 PM