Problems publishing a website on smarterasp.net with csc.exe file included? Problems publishing a website on smarterasp.net with csc.exe file included? asp.net asp.net

Problems publishing a website on smarterasp.net with csc.exe file included?


After hours of researching i came up with the solution.

Since the .NET 4.5 version, Roslyn compilation is the default way of compiling. This means if you create any web application either Web Forms or MVC using .NET 4.5 you get this Roslyn csc.exe compilation pre-installed in your project.

Basically what i needed was to compile and deploy my project without Roslyn or any .exe files on it.

So here is the Solution that worked for me. You can deploy without Roslyn with no change in code:

  1. Open NuGet Package Manager window
  2. uninstall Microsoft.CodeDom.Providers.DotNetCompilerPlatform package and rebuild & republish. (This uninstallation also removes CodeDom configuration from web.config file.)

This will solve your purpose. Basically this will not generate any csc.exe, vbc.exe files inside bin folder.

I hope it works for you too!


I had this issue on Smarter ASP. On the browser file manager in the control panel, navigate to 'Roslyn' folder in bin and set .net permission to read/write. It worked then.


If you actually want to keep the roslyn codegen, you just need to set the permissions on the application's bin folder to allow the ApplicationPool user Read & Execute.

I did this using the explorer Security tab on the folder properties dialog, but you should also be able to do something like:

icacls PATH_TO_SERVICE_BIN /grant "ApplicationPoolUser":(OI)(CI)RX