Parser Error: Could not load the assembly 'App_Web_ah9y-lsc'

5.3k views Asked by At

The site works fine when I'm running it locally, I published it and hosted to a hosting space hired by my company via SMART FTP.There is a folder with my company's name eg. 'MyCompany'. It has sub folders such as App Data, App Code, Bin, Httpdocs,Httpsdocs...etc. I transferred my published project'UtilityServices' to Httpdocs. Then i enter www.MyCompany.net/UtilityServices/Customer_Login.aspx i got the following error.

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 the assembly 'App_Web_ah9y-lsc'. Make sure that it is compiled before accessing the page.

Source Error:

Line 1:  <%@ page language="C#" autoeventwireup="true" inherits="Customer_Login, App_Web_ah9y-lsc" %>
Line 2:  <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
Line 3:  


Source File: /UtilityServices/Customer_Login.aspx    Line: 1 

Httpdocs has a bin folder and a webconfig, the hosted UtilityServices has a bin and webconfig. Is this the reason for this error.

I am using VS2008 C# 3.5 Framework.

3

There are 3 answers

3
neeKo On

I've had similar problems when transferring files to a web server - what I presume to be happening is that files somehow get corrupted in transfer, and you get weird assembly names.

What worked for me is, if I could find out what files broke the build on server (if it worked before I uploaded a batch, then I got compile error of this type), I would make minor changes (press space and backspace) to force a save on them, and reupload those files, and in turn that would make server recompile them again and the error would be gone.

Hope this works for you :)

0
Nathan Anderson On

If the app you have in /UtilityServices/ has it's own App_Code folder, etc, then the directory needs to be configured as an Application in IIS. See this link for instructions on how to do this.

If you cannot configure the webserver, try placing the files in your App_Code, bin, etc folders in there corresponding folders at the root of the site.

0
Arun Banik On

Well, it is an old question and still many search for a relevant answer to this problem. You need to change the site to an application in the IIS. Just open the IIS manager and choose the site which has been compiled. Right click the site and choose "Convert to Application". No need to restart the IIS, but there is no harm if you do that. This will solve the problem.