Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parser Error when deploy ASP.NET application

I've finished simple asp.net web application project, compiled it, and try to test on local IIS. I've create virtual directory, map it with physical directory, then put all necessary files there, including bin folder with all .dll's In the project settings, build section, output path is bin\ So when i try to browse my app i got:

Server Error in '/' Application.
--------------------------------------------------------------------------------

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 'AmeriaTestTask.Default'.

Source Error: 


Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AmeriaTestTask.Default" %>
Line 2:  
Line 3:  <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>


Source File: /virtual/default.aspx    Line: 1 

enter image description here

Have read similar problem posts and solution was to set output path to bin\, but it is defalut for my project.

like image 950
igorGIS Avatar asked Feb 10 '13 17:02

igorGIS


People also ask

What is parser error in asp net?

A ParserError object represents an error that is created when an HttpParseException exception is thrown. A parser error object can contain error message text, a virtual path to the file where the error occurred, and the subsequent line number of the error in that file.

What causes Server error in '/' Application?

The “Server error in '/' application” can occur if there is a typo in the file extension, for example a file or URL that references test. htl instead of test. html. If the file name is correct, then you may need to add the MIME typeto the server.

What does parsing failure mean?

A formula parse error happens when you enter a formula into a cell, and the spreadsheet software cannot understand what you want it to do. It's like trying to speak a different language without taking the time to learn it first.


4 Answers

I know i am too late to answer but it could help others and save time.

Following might be other solutions.

Solution 1: See Creating a Virtual Directory for Your Application for detailed instructions on creating a virtual directory for your application.

Solution 2: Your application’s Bin folder is missing or the application’s DLL file is missing. See Copying Your Application Files to a Production Server for detailed instructions.

Solution 3: You may have deployed to the web root folder, but have not changed some of the settings in the Web.config file. See Deploying to web root for detailed instructions.

In my case Solution 2 works, while deploying to server some DLL's from bin directory has not been uploaded to server successfully. I have re-upload all DLL's again and it works!!

Here is the reference link to solve asp.net parser error.

like image 105
immayankmodi Avatar answered Nov 15 '22 05:11

immayankmodi


I had the same issue. Ran 5 or 6 hours of researches. A simple solution seems to be working. I just had to convert my folder to application from iis. It worked fine. (this was a scenario where I had done a migration from server 2003 to server 2008 R2)

(1) Open IIS and select the website and the appropriate folder that needs to be converted. Right-click and select Convert to Application.

enter image description here

like image 29
Aravinda Avatar answered Nov 15 '22 06:11

Aravinda


Try changing CodeBehind="Default.aspx.cs" to CodeFile="Default.aspx.cs"

like image 21
Codeone Avatar answered Nov 15 '22 05:11

Codeone


Sometimes it happens if you either:

  1. Clean solution/build or,
  2. Rebuild solution/build.

If it 'suddenly' happens after such, and your code has build-time errors then try fixing those errors first.

What happens is that as your solution is built, DLL files are created and stored in the projects bin folder. If there is an error in your code during build-time, the DLL files aren't created properly which brings up an error.

A 'quick fix' would be to fix all your errors or comment them out (if they wont affect other web pages.) then rebuild project/solution

If this doesn't work then try changing: CodeBehind="blahblahblah.aspx.cs"

to: CodeFile="blahblahblah.aspx.cs"

Note: Change "blahblahblah" to the pages real name.

like image 40
Onga Leo-Yoda Vellem Avatar answered Nov 15 '22 05:11

Onga Leo-Yoda Vellem