Publishing a site without roslyn

I am trying to create a web application using Visual Studio 2015 and .NET 4.5.1. When I publish the website, visual studio will create a folder called roslyn .

enter image description here

I know that it was used to compile the code on the fly, but, unfortunately, my hosting provider does not allow me to execute the compiler on my server.

How to publish a site without roslyn , like the previous version of Visual Studio?

EDIT: I got this error while trying to access my site.

enter image description here

IIS seems to be trying to execute roslyn\csc.exe , but my user account does not have permission to do this. With the previous version of Visual Studio, this error does not appear.

+80
visual-studio visual-studio-2015 roslyn
Aug 29 '15 at 5:02
source share
7 answers

I ran into the same problem. When you create a new web project, two nuget packages are automatically added to your project. If you delete them, your problem should be resolved. Package names: " Microsoft.CodeDom.Providers.DotNetCompilerPlatform " and " Microsoft.Net.Compilers ".

+170
Aug 30 '15 at 9:30
source share

I had the same problem. Follow the instructions from here . Basically:

  1. Delete package

     Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform <Your Web API project name> 
  2. In the settings of your publication profile, uncheck the box "Allow updating the compiled site." You can find this in Settings> Precompile at Publish Time> Settings

+13
Nov 26 '15 at 23:15
source share

After countless efforts ... and in accordance with this website . I find that you can use /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false in MSBuild to convert web.config, this also includes the roslyn compiler in the assembly. The result is similar to what you get when publishing in Visual Studio on the file system

+2
Mar 27 '17 at 10:15
source share

There is a problem opening the error in the roslyn repository.

In my case, all I had to do was downgrade the Microsoft.CodeDom.Providers.DotNetCompilerPlatform dll from version 1.0.6 to 1.0.5 .

+2
Aug 15 '17 at 13:57 on
source share

After searching for the same released I came across, I just came here. I read the answer above correctly.

I give an answer because Here is a good article to explain:

  • Why is there this exe in the publication code, as well as a development environment?
  • What is the use and how to remove?

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

+1
Nov 24 '15 at 6:13
source share

I had the same problem in September 2012 when I took over the existing ASP.NET program. I found that several versions of the two compiler packages mentioned by Kemal were installed in different solution projects.

So, first I updated to get them the same way. VS doesn't tell you that updates are available in this scenario (or maybe I missed them?)

Then I had to restart VS2015 to properly clear the packages.

0
Sep 10 '16 at 5:15
source share

I just ran into the same problem. When you create a new web project, two nuget packages are automatically added to your project. If you delete them, your problem should be resolved. Package names: "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" and "Microsoft.Net.Compilers". Thank you, Kemal, but I get this error after doing it; mistake

0
Jun 13 '19 at 1:16
source share



All Articles