1

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.

madhead
  • 31,729
  • 16
  • 153
  • 201
David John
  • 493
  • 6
  • 11
  • 18
  • Is there a file in the /UtilityServices/bin folder of your site with the name App_Web_ah9y-lsc.dll? – Sir Crispalot Nov 03 '11 at 15:14
  • yes in the bin folder of UtilityService – David John Nov 04 '11 at 10:37
  • It sounds like the answer suggested by @Nathan could be correct. If you've deployed the files to a subfolder of the site root, it would need to be configured as an application. You may or may not have the ability to do this depending on your host provider's configuration. It might be worth trying to republish the site to the root instead (not in a UtilityServices folder) as your hosting provider most probably has that configured as an application by default. – Sir Crispalot Nov 04 '11 at 10:57

3 Answers3

1

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.

Arun Banik
  • 470
  • 4
  • 9
0

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 :)

neeKo
  • 4,280
  • 23
  • 31
  • That is basically it. Make a minor change to your latest uploaded files, then upload them again. – neeKo Nov 03 '11 at 15:53
  • Press space then backspace (only so the asterix to save the file again appears). Try it with files you uploaded after the point in which you know your site was working properly. – neeKo Nov 03 '11 at 16:17
  • Are you using Visual Studio? Because if you make a change to a source file in Visual Studio, an asterix appears next to the name in the tab, indicating there was a change. Anyway, just type one character then delete it. This should force a recompile on the server :) – neeKo Nov 03 '11 at 17:12
0

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.

Nathan Anderson
  • 6,768
  • 26
  • 29