Publish website without roslyn

I've just faced the same problem. When you create a new web project, two nuget packages automatically added to your project. If you remove them, your problem should be solved. Package names are: "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" and "Microsoft.Net.Compilers".


After searching the same issued I face, I just came here. I read the above answer which is right.

I give the answer, because of Here is the good article to explain :

  1. Why the publish code have this exe as well as development environment ?
  2. What is the benefit and how to remove?

This is also the very good article, about the history of this exe


After countless effort....and according to this website. I find that you can use /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false in MSBuild to transform web.config, this also include the roslyn compiler in the build. The output is same as what you get by publishing in Visual Studio into file system


I had the same issue. Followed the steps from here. Basically:

  1. Uninstall the package

    Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform <Your Web API project name>
    
  2. In your publish profile settings, uncheck "Allow precompiled site to be updatable". You can find this under Settings > Precompile during publishing > configure