Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC IIS 7.5

Tags:

asp.net-mvc

I have follwing erorr after I have published site in IIS 7.5 and i don't hnow what to do

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 'ProiectLicenta.MvcApplication'.

Source Error:

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

like image 732
alinpopescu Avatar asked Nov 14 '22 11:11

alinpopescu


1 Answers

The solution you accepted is incomplete. For the sake of others researching this problem in the future, I'll elaborate.

Literally, this means that ASP.NET couldn't locate the type 'ProiectLicenta.MvcApplication'.

This can happen for a number of reasons. In order of likelyhood (imho, of course), they are:

  1. You are ignoring an error when building your site. If the assembly or project that contains ProiectLicenta.MvcApplication can not be compiled, then ASP.NET will not be able to locate any classes or other entities therein contained. Solution: correct all compiler errors and try again.

  2. The class ProiectLicenta.MvcApplication is not explicitly declared with the correct access specifier. Remember, classes declared like

    class MyClass { ... }

    are private. You'll probably want to change the declaration to

    public class MyClass { ... }

  3. You are deploying your site and not including the assembly (DLL) which defines the type ProiectLicenta.MvcApplication. Correct your deployment process and try again.

like image 71
3Dave Avatar answered Dec 09 '22 18:12

3Dave