{"id":878,"date":"2018-06-01T07:26:58","date_gmt":"2018-06-01T07:26:58","guid":{"rendered":"http:\/\/www.netexl.com\/blog\/?p=878"},"modified":"2026-04-02T09:57:32","modified_gmt":"2026-04-02T09:57:32","slug":"publish-an-asp-net-website-without-roslyn-folder","status":"publish","type":"post","link":"https:\/\/www.netexl.com\/blog\/publish-an-asp-net-website-without-roslyn-folder\/","title":{"rendered":"Publish an ASP.NET website without roslyn folder"},"content":{"rendered":"<p>If you create a ASP.ENT website using Visual Studio 2015 or higher and .NET Framework 4.5.2, it by default uses Roslyn which is a set of open-source compilers and code analysis APIs for C# and Visual Basic. Publishing this would also include &#8220;roslyn&#8221; folder in bin directory containing a bunch of libraries and exe files which creates issues if you are using a shared hosting service as normally shared hosting do not run under full\u00a0trust. We can simply remove this\u00a0by going to<\/p>\n<p>Tools -&gt; NuGet Package Manager -&gt; Manager NuGet Packages for Solution -&gt; Uninstall following packages<\/p>\n<ul>\n<li><strong>Microsoft.CodeDom.Providers.DotNetCompilerPlatform<\/strong><\/li>\n<li><strong>Microsoft.Net.Compilers<\/strong><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-879\" src=\"https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2018\/06\/Roslyn.png\" alt=\"\" width=\"1366\" height=\"731\" srcset=\"https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2018\/06\/Roslyn.png 1366w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2018\/06\/Roslyn-300x161.png 300w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2018\/06\/Roslyn-768x411.png 768w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2018\/06\/Roslyn-1024x548.png 1024w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2018\/06\/Roslyn-280x150.png 280w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<p>Check web.config and make sure the following section was removed by the NuGet package uninstall. If it did not get removed for any reason, then clean it up\u00a0manually<\/p>\n<pre class=\"lang:default decode:true \">  &lt;system.codedom&gt;\r\n    &lt;compilers&gt;\r\n      &lt;compiler language=\"c#;cs;csharp\" extension=\".cs\"\r\n        type=\"Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\"\r\n        warningLevel=\"4\" compilerOptions=\"\/langversion:6 \/nowarn:1659;1699;1701\"\/&gt;\r\n      &lt;compiler language=\"vb;vbs;visualbasic;vbscript\" extension=\".vb\"\r\n        type=\"Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\"\r\n        warningLevel=\"4\" compilerOptions=\"\/langversion:14 \/nowarn:41008 \/define:_MYTYPE=\\&amp;quot;Web\\&amp;quot; \/optionInfer+\"\/&gt;\r\n    &lt;\/compilers&gt;\r\n  &lt;\/system.codedom&gt;\r\n<\/pre>\n<p>Now publish your website and you won&#8217;t see roslyn folder inside bin directory anymore.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you create a ASP.ENT website using Visual Studio 2015 or higher and .NET Framework 4.5.2, it by default uses Roslyn which is a set of open-source compilers and code analysis APIs for C# and Visual Basic. Publishing this would also include &#8220;roslyn&#8221; folder in bin directory containing a bunch of libraries and exe files which creates issues if you are using a shared hosting service as normally shared hosting do not run under full\u00a0trust. We can simply remove this\u00a0by going to Tools -&gt; NuGet Package Manager -&gt; Manager NuGet Packages for Solution -&gt; Uninstall following packages Microsoft.CodeDom.Providers.DotNetCompilerPlatform Microsoft.Net.Compilers Check web.config and make sure the following section was removed by the NuGet package uninstall. If it did not get removed for any reason, then clean it up\u00a0manually &lt;system.codedom&gt; &lt;compilers&gt; &lt;compiler language=&#8221;c#;cs;csharp&#8221; extension=&#8221;.cs&#8221; type=&#8221;Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8243; warningLevel=&#8221;4&#8243; compilerOptions=&#8221;\/langversion:6 \/nowarn:1659;1699;1701&#8243;\/&gt; &lt;compiler language=&#8221;vb;vbs;visualbasic;vbscript&#8221; extension=&#8221;.vb&#8221; type=&#8221;Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8243; warningLevel=&#8221;4&#8243; compilerOptions=&#8221;\/langversion:14[&#8230;]<\/p>\n","protected":false},"author":5,"featured_media":1540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,14],"tags":[],"class_list":["post-878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net","category-how-to"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/comments?post=878"}],"version-history":[{"count":1,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/878\/revisions"}],"predecessor-version":[{"id":880,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/878\/revisions\/880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media\/1540"}],"wp:attachment":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media?parent=878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/categories?post=878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/tags?post=878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}