Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC and Visual Studio 2013: Compilation Error

From time to time I get "Compilation Error" CS0042 yellow page: http://i.stack.imgur.com/Hwfip.png

Compilation Error yellow page

It happens when I change something (i.e. .cshtml file code) when my application is running. In VS 2012 it caused no problems. Some of my co-workers using VS 2013 have the same issue. Why App_GlobalResources.PDB file causes the problem?

Anyone has the same problem?

like image 372
pinus.acer Avatar asked Oct 02 '22 02:10

pinus.acer


2 Answers

In your Web.config file remove attribute optimizeCompilations="true" (from section <compilation />)

like image 59
Tomasz Maj Avatar answered Oct 19 '22 18:10

Tomasz Maj


According to this blog post, the problem is very much similar with yours. Please try the following things mentioned in the post:

  1. Exit VS.NET, restart VS.NET and reopen project
  2. Change project from Debug Build to Release Build and visa-versa.
  3. Remove all Enums from classes and just use in the namespace
  4. Ensure all DLL projects have ‘CopyLocal’ set to true AND references to these DLL’s be a Project Reference and not simple a DLL reference.

If it's not working, it should be a bug presented in the Visual Studio 2013 then.

Hope it helps.

like image 36
albusshin Avatar answered Oct 19 '22 19:10

albusshin