user998007
user998007

Reputation: 131

ASP.NET MVC, After rebuilding the solution, I get Parser Error(Server Error in '/' Application.) in Source File: /global.asax?

I am new in ASP.NET MVC. I have got a full project, trying to learn the projects functionality by test, comment and uncommenting the code, but here build and rebuild are confusing me.

When I test the project by building solution with zero error build I would get no error and also when I comment one or some line of code to test the functionality of project in MVC(By Building) and test the page it works despite some building error.

In rebuilding case, when some line of codes are commented then rebuilding the solution getting the :

Server Error in '/' Application.
Parser Error Message: Could not load type 'ProjectName.Web.NameApplication'.
Line 1:  <%@ Application Codebehind="Global.asax.cs"
Inherits="ProjectName.Web.NameApplication" Language="C#" %>

This is really very confusing for example: In the solution there is a project:

ProjectName.Core>>DataAccess(folder) inside the folder there are 20 classes like:

Daytaaccess>>DefaultStrategy.cs,DefaultStrategy,ExpressionValuePair,IDataAction.cs,IDataMod
el, IDataStrategy,IPropertyValuePair,IRepository,ISortation,ITransaction, 
IUnitOfWork , IUnitOfWorkFactory,PropertyValuePair.cs

By uncommenting all the classes the project still works except "PropertyValuePair.cs" but when I uncomment the PropertyValuePair.cs project won't work except uncommenting all the previously commented classes.

I think the issue is on Visual Studio Caching, not caching the commented code I have also tried commenting a table's entire class, in browser the pages still works and table's data still gets updated.

If it is so, how to remove caching in Visual Studio 2010?

Upvotes: 0

Views: 743

Answers (1)

danludwig
danludwig

Reputation: 47375

I don't think this is a caching problem. Visual studio does not cache builds. If there are multiple projects in the solution, there is a chance you are not building all of them, and that the MVC project is using previously-built dll's.

A better way to investigate code is to set breakpoints and debug. I wouldn't try commenting out code and re-running. That won't really teach you anything.

Upvotes: 1

Related Questions