-1

Not very experienced but lets give it a shot! Excuse the text.

I am making a Web application and I clicked on "Clean" on the project.csproj. Not knowing what i did I restarted my web application on IIS and I got a message saying this.

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 'DocPortal_S1.Global'.

Source Error: 
Line 1:  <%@ Application Codebehind="Global.asax.cs" Inherits="DocPortal_S1.Global" Language="C#" %>

And when returning to Localhost:port I still get this.

What does a clean do and is there a possibility to fix it?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
THchen
  • 11
  • 1
  • 6
  • oh excuse me. Removing the global and adding a new one also doesn't work – THchen Jan 15 '15 at 03:46
  • 1
    Is this a web site "project" (File->New Web Site), or a web application project (File->New Project)? Is there a .csproj file? – John Saunders Jan 15 '15 at 03:54
  • There is a .csproj in my solution explorer. it was File->New project -> Visual C# -> Web -> ASP.NET Web application. Some time has past and edited the CodeBehind to CodeFile. That didn't work but it worked when I placed 'partial' in all my cs files. Local and IIS are accepting this. I can watch my site now but I think i am doing something wrong at the moment – THchen Jan 15 '15 at 11:10

1 Answers1

0

Cleaning clears intermediate and output files of the selected project(s)/solution. It does not edit your actual project code files.

See: http://msdn.microsoft.com/en-us/library/ms171480.aspx

Your specific error indicates that the Global.asax file is looking into the Global.asax.cs file for a DocPortal_S1.Global class, but it can't find that object. Restore that class into your code-behind/global.asax, and you should be good to go.

Not sure why that would have been removed. I've run into similar issues if I've changed default namespaces around for a project or some refactoring to reorganize namespaces.

Jason W
  • 13,026
  • 3
  • 31
  • 62