views:

869

answers:

4

I am getting the following error on one of our production servers. Not sure why it is working on the DEV server?

Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'TestMvcApplication.MvcApplication'.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="TestMvcApplication.MvcApplication" Language="C#" %>

Source File: /global.asax Line: 1

Not sure if anybody came across this error before and how it was solved, but I have reached the end. Any help would be appreciated.

I also need to mention that this is the published code, so all is compiled. Can there be something wrong with my compiler settings?

A: 

The only time I have experienced this was when the MVC framework was not installed on the server. Could that be the case?

You might have a look here too, a missing Pages section in Views\Web.config could be at fault.

Kindness,

Dan

Daniel Elliott
Not sure, it is a hosted server and according to them ASP .NET MVC working fine.
Riaan Engelbrecht
I found another person (with Uncle Google) who experienced a similar error for a different reason. Added link to answer. Good luck!
Daniel Elliott
A: 

After a long hard look I came accross the real issue here.

The assemblies were corrupted by the FTP client I used to upload the files to a hosted environmet.

I changed my FTP client and all is working as intended.

Riaan Engelbrecht
A: 

I experienced the exact same problem a couple of days ago - as far as I can tell it was an issue with a 64-bit IIS running a 32-bit web application. We changed our production server to 32-bit and this issue disappeared.

Jaco Pretorius
+2  A: 

I've had this a couple of times. It's especially frustrating as it's right off the bat, and the error message holds no clue as to what might be the issue.

To fix this, right click your project title, in this case "TestMvcApplication" and click build.

This forces the code to compile before you run it. Don't ask me why, but this has been the solution 100% of the time for me.

Andy Copley