ASP.NET strange compilation error

I do not know what is wrong with my machine, but after a while I get the following strange error from ASP.NET (for all my applications).

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: The compiler failed with error code -1073741502. Show Detailed Compiler Output: C:\Windows\SysWOW64\inetsrv> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\75855fbd\1e953b27\assembly\dl3\2689d6b5\f0791420_961fcc01\wnvhtmlconvert.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\75855fbd\1e953b27\assembly\dl3\d08c81cd\4d77c01f_961fcc01\AjaxControlToolkit.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" ......AND SO ON..... 

Facts:

  • The Killing utility process temporarily resolves the issue.
  • I even reinstalled my .NET platform! This did not work.
  • Restarting IIS does not help

What can cause this problem?

+49
Jul 25 2018-11-21T00:
source share
20 answers

OK, after days struggling with this problem, I finally fixed it.

  • Not cleaning up ASP.NET temp
  • Without reinstalling the .NET framework!

Simple!

  • I changed the application pool identifier from "Local System" to "ApplicationPoolIdentity"

Apparently, there was a permission error on my local system that the C # compiler (csc.exe) was not able to access some resources and source codes.

To change the AppPool ID, follow these steps: http://learn.iis.net/page.aspx/624/application-pool-identities/

+23
Aug 03 2018-11-11T00:
source share

I uninstalled the Roslyn related packages using NuGet and now it works.


Roslyn related packages:

  • Microsoft.CodeDom.Providers.DotNetCompilerPlatform
  • Microsoft.Net.Compilers


PS: My local IIS has no problems with Roslyn , but as the project is published on the server (so I don't think the server supports Roslyn ), it shows the following error message:

Compilation error

Description: An error occurred while compiling the resource required to service this request. Review the following specific error details and modify the source code accordingly.

Compiler Error Message: Compiler failed with error code -532462766.

Show Detailed Compiler Output:

 C:\Windows\SysWOW64\inetsrv>D:\...\wwwroot\bin\roslyn\csc.exe /t:library /utf8output /nostdlib+ /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\08433893\97359c03_e1abd201\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\2574b56e\eed229e7_dfabd201\Autofac.Integration.WebApi.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Web.PageInspector.Loader\v4.0_1.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Web.PageInspector.Loader.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\2da0bd13\b2333a9c_e0abd201\System.Net.Http.Formatting.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\99fd000f\fe3c7c0e_e1abd201\System.Web.WebPages.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\695a732a\7a32e84e_e2abd201\WebGrease.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\ca091706\f1f4ae28_78afd201\Core.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\ce3c4f34\2b7b911a_e0abd201\EntityFramework.SqlServer.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\c73494ac\8f453228_78afd201\CommonViewModels.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Web.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e35\Microsoft.Web.Infrastructure.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\03d13810\0845500f_e1abd201\System.Web.Http.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\5cc83c73\51b7f8fe_e0abd201\System.Web.Http.WebHost.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\290d81d3\fb074b29_78afd201\Data.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\7a5d0293\283dbf3a_e0abd201\GridMvc.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\eb50e8c6\1900fa91_e0abd201\System.Web.Razor.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\a7d6ceb3\4c5f9c2c_78afd201\Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\3bd130ea\7b432ba6_e0abd201\System.Web.Optimization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\8486430e\674206e7_dfabd201\Autofac.Integration.Mvc.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\c0d9cc06\83811806_e1abd201\System.Web.WebPages.Razor.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\8835020a\58c1c60e_e1abd201\System.Web.Helpers.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\30c33f64\00d8a820_d154d201\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\6ea00d7f\02323228_78afd201\Extensions.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\f8f1e397\e9660a29_78afd201\Services.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\ff57243f\bb5e8b92_e0abd201\System.Web.Mvc.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\fd2c5d18\00ae74dd_e7acd201\Autofac.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\a44c79bb\74928fbb_e0abd201\EntityFramework.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\227cd18a\6ab66d28_78afd201\Domain.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\assembly\dl3\8cbb60ec\00788858_b3abd201\Newtonsoft.Json.dll" /out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\App_Code._bgj8eyw.dll" /debug- /optimize+ /warnaserror- /w:4 /nowarn:1659;1699;1701;612;618 /langversion:6 /nowarn:1659;1699;1701 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\App_Code._bgj8eyw.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a47e39f5\cc42bc06\App_Code._bgj8eyw.1.cs" 


How to remove Roslyn packages.

In Solution Explorer, right-clicking on a web project, select Manage NuGet Packages...
Click the Installed tab, then find the appropriate Roslyn packages, as described above.
Use the Uninstall button to remove them.

+66
Apr 7 '17 at 9:32 on
source share

Delete C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\

+13
Jul 25 2018-11-14T00:
source share

What worked for me ... It seems that if you install (or install the dependent package) the Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package, it does some web.config conversions that allow you to use C # 7.x to ASP.NET Shaving functions pages. Although I found that they work fine on my local machine, they do not work on our server (even when the compiler was in the / bin / folder).

The solution was to find the item below and remove it completely from web.config

  <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> 
+12
Apr 18 '18 at 15:49
source share

I also have this error, but the problem here was completely different. So in my case, I got a compiler error from a temporary file that I used a non-existent namespace for example:

 using ImaginaryNamespaces; 

I was sure that the code "uses ImaginaryNamespaces"; dosn't exist in my solution, so of course I doubt the cache problem. Finally, I realized that the temporary file was some generated source file from the configurations. My views /Web.Config had the line:

 <add namespace="ImaginaryNamespaces"/> 

After removal, it worked. Therefore, I recommend making sure that there is no data in the configurations that may be due to a compiler error.

+11
Jun 10 '15 at 15:00
source share

Answers are not a solution. The stuff of .NET 6 # is quite different from what we used. A lot has changed - from the need to deal with portable libraries, so that Visual Studio 2015 installs the old compiler (it cost me four hours to crack my head).

In short: stack overflow question How to use C # 6 with a website project type?

You need to install the C # .NET compiler (now it starts as a bla bla bla service). and you need to run updates on NuGet to get the latest (before trying anything else).

The compiler must be installed in the project from which your solution is executed (for example, your website or your main project, from which your application starts (if you have several projects)).

Once you have installed this, sort your web.config, referring to any portable libraries, and delete both the bin folder and obj (to avoid working on my computer's nightmare), it should just start. But be patient; what happens on your computer may vary depending on the answers above. Most of the answers above hide other problems. It may work for a while, and then boom: a compiler error. Several pages worked for me, then some pages started crashing due to some packages that started using portable libraries.

+7
Apr 7 '16 at 21:14
source share

I just ran into this in .NET 4.6.1, and in the end it had a simple solution - I deleted (actually commented out) the section in web.config, and the web form application came back to life. See what system-codedom-compilers-do-in-web-config-in-mvc-5 does for more information.

It worked for me.

+7
May 12 '16 at 17:06
source share

In IIS Manager, in the advanced settings of the application pool, make sure that the "Process Model → Download User Profile" is set to "True". In my case, it worked.

+3
May 04 '16 at 12:41
source share

If you get the error message "Error compiling the resource required to service this request. Compiler error message: Compiler error with error code 255."

Try completing the "VBCSCompiler.exe" processes. VBCSCompiler.exe can also be a problem if your application cannot create due to the fact that some packages cannot be moved to the bin folder.

+2
Aug 01 '15 at 10:18
source share

I scanned many blog posts, including several stacks for, and I already had everything that was suggested in these posts (see below) when I received this error.

  • My application pool is running under ApplicationPoolIdentity
  • The user profile upload was installed in the section “Truth in the process model”.
  • IIS AppPool \ DefaultAppPool has full permissions on the ASP.NET temp file folder

Finally, I found some tips in the blog post below. It looks like there is a bunch with the same user account. Therefore, I changed the application pool identifier to LocalSystem, for an application that does not work with this error, and my application started working normally.

See the blog post C # compiler or Visual Basic.Net compilers with error code -1073741502 will generate assemblies for your ASP.net site .

Note. The LocalSystem account will not have large permissions. In my case, my application does not need any special permissions. So I was fine. If your application needs special permissions, try setting up a user account.

+2
Oct 24 '16 at 19:34
source share

I solved this by deleting the contents of the bin and obj folders for the project and the contents of the bin folder on the remote server and then redistributing it.

+2
Nov 18 '16 at 15:27
source share

If you are still trying to solve this problem, even after all the options, try to find an application that works and takes up huge memory.

In my case, this is an application in which more than 100 instances were launched due to some error, and gained at least 20 MB per application, which is approximately 2 GB.

After I killed several applications and the memory was released, my site was back online.

+1
May 26 '14 at 15:58
source share

If you deployed this application on your server, it is possible that the * .config files in the \ bin \ roslyn folder have been deleted.

Then look if files exist, such as:

  • csc.exe.config
  • csi.exe.config
  • vbc.exe.config
  • VBCSCompiler.exe.config

These files may vary depending on your project links.

+1
Apr 02 '18 at 13:13
source share

Cause. I noticed that when I clean up a project or clear one of the dependent projects, and then I click update several times on the page showing the site, this causes this error. It looks like he is trying to somehow load / run a damaged / missing DLL project.

Rename the IIS project directory to something else and with a new name it loads fine (a newly created project is first created OK, and then executed otherwise, it causes the same problem)

0
Oct 09 '15 at 13:54 on
source share

I got the same error, got out of nowhere. After several hours of working on all the solutions mentioned here and in other forums, the simple “Clean solution” and “Rebuild” in VS2015 worked for me.

0
Jan 17 '17 at 2:48 on
source share

I had to kill several instances of MSBuild.exe hanging in the process explorer.

Then the website is working fine.

0
Jan 24 '17 at 12:21
source share

Nuget package update fixed for me.

0
Mar 09 '17 at 10:41
source share

I got this error message, and for me there was a decision to install Dot Net Framework 4.6, while my project was targeting 4.5.2

0
Sep 11 '17 at 9:14 on
source share

The version of Microsoft.Net.Compilers (3.0) used in my project was not compatible with the version of .NET installed on the server.

I downgraded to 2.1, and now everything is working fine.

I assume this is due to the different versions of the .Net Framework (supposedly .NET Core) installed on the server.

0
Apr 17 '19 at 19:00
source share

In my case, I just stop and start the application pool, and it returns to life !!!

-one
Jan 13 '17 at 12:29
source share



All Articles