0

I am attempting to publish a Webforms website and noticed that the bin folder contains the 'roslyn' subfolder.

After researching it appears that removing 2 nugget packages would resolve the issue.

The problem is that removing the packages doesn't work.

I tried the Nuget package manager console:

uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform  
uninstall-package Microsoft.Net.Compilers  

I also tried updating the web.config (and removing the references):

  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.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.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>

I still get the 'roslyn' folder when publishing. Is this issue possible because the Visual Studio solution was created in a earlier version of VS but the web project was created under VS2015?

John M
  • 14,338
  • 29
  • 91
  • 143

1 Answers1

0

I know this is old, but maybe it still helps someone.

The reason you still get the 'roslyn' folder is your .csproj project file. Open it for editing and remove the <Target ...> tag (incl. subtags) referencing the 2 NuGet packages you had to remove the references to.

In my case, there was only one (Microsoft.CodeDom.Providers.DotNetCompilerPlatform), but according to this question, there might be tags for both (see Brian's answer).

Rolf
  • 1
  • 4