473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help interpreting error?

I have an ASP.NET 2.0 web application that runs fine on my local
machine. However, once I upload it, I get this error:

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: The file '/index.ascx.cs' does not exist.

Source Error:

Line 1: <%@ Control Language="c#" Inherits="mysite.IndexContent"
CodeFile="index.ascx.cs" %>

Source File: /index.ascx Line: 1

The DLL is in the remote server's bin folder. All of the ASPX and ASCX
files are there as well. Any ideas?

Thanks,
Brett

Oct 21 '06 #1
14 2026
Hi,

brett wrote:
I have an ASP.NET 2.0 web application that runs fine on my local
machine. However, once I upload it, I get this error:

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: The file '/index.ascx.cs' does not exist.

Source Error:

Line 1: <%@ Control Language="c#" Inherits="mysite.IndexContent"
CodeFile="index.ascx.cs" %>

Source File: /index.ascx Line: 1

The DLL is in the remote server's bin folder. All of the ASPX and ASCX
files are there as well. Any ideas?

Thanks,
Brett
You are mixing two models. On one hand, you can publish CS files to your
server, and the classes will be compiled on demand. On the other hand,
you can publish one or more DLL.

In the first case, you refer to the CS file using the CodeFile attribute.

However, in the second case, you must refer to the file without the
"CodeFile" attribute, but using the "Inherits" attribute only. In that
case, the assembly gets looked for in the "bin" directory. You can also
specifiy the assembly name if you know it, using this syntax:

inherits="ControlName, AssemblyName"

Normally, when you use the "web site" model and "publish" it, the
references in the ASCX and ASPX files are automatically updated to the
second way.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 21 '06 #2
Thanks. That fixed the first problem. But when I upload contents from
the local Published folder, I get this:

I found out the problem was that I wasn't published the site. I've
created a local published folder and published there. Then I uploaded
to the remote server. Now I get this error:

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 'mysite.Global'.
Source Error:
Line 1: <%@ Application Inherits="mysite.Global" Language="C#" %>
Source File: /global.asax Line: 1

I then created a virtual directory on the local Published folder. When
I access it via http, I get this:

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: The file '/Published/index.ascx.cs' does not
exist.
Source Error:
Line 1: <%@ Control Language="c#" Inherits="mysite.IndexContent"
CodeFile="index.ascx.cs" %>
Source File: /Published/index.ascx Line: 1
Should it not be looking for CS files after being published?

Thanks,
Brett

Oct 21 '06 #3
I followed your suggestion and changed the aspx files to use
inherits="ControlName, AssemblyName". Apparently the publishing
doesn't change it.

I still have the issue with the Global.asax file.

Thanks,
Brett

Oct 21 '06 #4

brett wrote:
I followed your suggestion and changed the aspx files to use
inherits="ControlName, AssemblyName". Apparently the publishing
doesn't change it.

I still have the issue with the Global.asax file.
Drat! I never could get the Global.asax file to open in the VS.NET
editor. I opened it in Notepad and changed the top line to use

inherits="ControlName, AssemblyName"

That fixed it. Everything seems fine. Do you know why the Publishing
didn't change the inherits part?

Thanks,
Brett

Oct 21 '06 #5
Hi,

brett wrote:
Thanks. That fixed the first problem. But when I upload contents from
the local Published folder, I get this:

I found out the problem was that I wasn't published the site. I've
created a local published folder and published there. Then I uploaded
to the remote server.
How do you compile / publish your website? Do you use the web
application project?

Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 21 '06 #6
Hi,

brett wrote:
brett wrote:
>I followed your suggestion and changed the aspx files to use
inherits="ControlName, AssemblyName". Apparently the publishing
doesn't change it.

I still have the issue with the Global.asax file.

Drat! I never could get the Global.asax file to open in the VS.NET
editor. I opened it in Notepad and changed the top line to use

inherits="ControlName, AssemblyName"

That fixed it. Everything seems fine. Do you know why the Publishing
didn't change the inherits part?

Thanks,
Brett
No, I don't. Try to create a small website and to publish it to test.

Also, the "publish" option changes it if you choose the "new website"
option only. If you use thw web application project, it doesn't. Are you
mixing both concepts?

Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 21 '06 #7
I have an ASP.NET application project. I right click on the project
and choose Publish. I have chosen the "Target location" as the local
file system and http but that didn't matter for my issue. I have these
options selected:

- Replace matching files with local copies
- Only files needed to run this application

I then click Publish. It publishes into a sub folder of my current
project. That sub folder is a virtual directory so I can test it via
http. I then FTP the contents of the sub folder onto my remote server.

Does that help?

Thanks,
Brett

Oct 21 '06 #8
Hi,

brett wrote:
I have an ASP.NET application project. I right click on the project
and choose Publish. I have chosen the "Target location" as the local
file system and http but that didn't matter for my issue. I have these
options selected:
If you mean the web application project (WAP) described here
http://webproject.scottgu.com/
then I think you have a problem, or maybe you made a mistake when you
created the control.

When you add a User Control in the WAP, the Control directive on top of
the page doesn't carry the CodeFile attribute. Could it be that

- You added that attribute yourself
- You included an existing ASCX file from another project in the current one
- You converted an ASP.NET 2 website to the WAP?

That would explain why the CodeFile attribute is found. That also
explains why the attribute remains when you publish it, because in the
WAP, the ASCX and ASPX files are left as is.

If you leave the CodeFile attribute in the directive, but the file
doesn't exist, you can compile the code, but you will have a runtime
error when the page is loaded the first time.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 21 '06 #9
When I created the project, I selected ASP.NET Web Application. I
don't think this is a WAP. I did add some of the ASCX controls from a
1.1 Framework project. But then I also added ASCX controls new into
this 2.0 project. For both, the CodeFile attribute was there. Guess
I'll just need to make sure I always change that.

I do have an option to convert this project to a Web Application.

Thanks,
Brett

Oct 22 '06 #10
Hi,

brett wrote:
When I created the project, I selected ASP.NET Web Application.
Yes, it is. The ASP.NET Web Application option appears in the "New
project" dialog only if the WAP is installed.

If you don't have it, the only way to create a new website is to *not*
use the "New project" dialog, but to use the "New website" dialog.
I
don't think this is a WAP. I did add some of the ASCX controls from a
1.1 Framework project. But then I also added ASCX controls new into
this 2.0 project. For both, the CodeFile attribute was there. Guess
I'll just need to make sure I always change that.
Yes. I tested on my VS2005, creating new projects and adding new pages
and user controls. The CodeFile attribute was never included (in the
WAP). It might be an option somewhere, though I doubt it.
>
I do have an option to convert this project to a Web Application.

Thanks,
Brett
Where do you have this option?

Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 22 '06 #11
Where do you have this option?

When I right click the project in Solution Explorer.

Brett

Oct 22 '06 #12
Hi,

brett wrote:
>Where do you have this option?

When I right click the project in Solution Explorer.

Brett
Interesting. I don't have that option. I wonder why our installations
differ this way.

Anyway. Observe the CodeFile attribute and you should be fine. Bottom
line is: It must be set only if the source file is actually available,
and not compiled in a DLL.

Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 22 '06 #13
Anyway. Observe the CodeFile attribute and you should be fine. Bottom
line is: It must be set only if the source file is actually available,
and not compiled in a DLL.
Ok, not such a big deal.

It may not matter but I didn't have an "ASP.NET Web Application"
project icon in VS.NET 2005. I had to download two updates before it
appeared:

http://www.microsoft.com/downloads/d...displaylang=en

and

http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx

Brett

Oct 22 '06 #14
Hi,

brett wrote:
>Anyway. Observe the CodeFile attribute and you should be fine. Bottom
line is: It must be set only if the source file is actually available,
and not compiled in a DLL.

Ok, not such a big deal.

It may not matter but I didn't have an "ASP.NET Web Application"
project icon in VS.NET 2005. I had to download two updates before it
appeared:

http://www.microsoft.com/downloads/d...displaylang=en

and

http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx

Brett
Yes, that's the WAP.

Based on what you posted earlier, my guess now is that you were actually
having a web site, and something when wrong when you published.

I will close this long thread here now, if you agree, because we are not
really going to go much further now :-) I suggest that you make a few
tries with: Web site, WAP, publish, XCOPY, etc... and see how it works.
I think it's quite important to understand what happens then. Should
something strange (continue to) happen, I suggest trying a reinstall.
And of course, posting here remains a good idea if something is not clear.

Cheers,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 22 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: deancoo | last post by:
Hello all, I'm new to the C++ STL, and am trying to wrap my head around why the following piece of code doesn't compile. What am I doing wrong? Thanks for any help. d #include <cstdlib>...
22
by: Rich | last post by:
I am trying to create a site that will re-direct a user based on their OS. For this site I will need to send NT4 and 95 users to site A and 2000/XP users to site B. All others should be directed...
0
by: Nick Leeson | last post by:
Hi, I am using the DDD front-end to debug a program I wrote in C. I got the following error message... --------------------------------------------------------------- Program received signal...
0
by: Jeff Friedman | last post by:
Hi all, I have a C# app which is executing simple WMI queries to multiple machines. Some are Win2000, and some are Win2003. I am suddenly running into a problem connecting to WMI on some of the...
7
by: Vinay | last post by:
Hi, I am using Excel in my VB.Net project. While deploying my application on a separate machine, I am getting the following error: File or Assembly name Interop.Excel or one of its...
2
by: brynk | last post by:
Anyone please help... I'm a newbie on creating functions in postgresql. Here is an oracle package that I'm trying to port to postgresql: CREATE OR REPLACE PACKAGE BODY NewsPkg.NewsTools AS...
43
by: ZillionDollarSadist | last post by:
Hello, I'm working at a simple Access '97 + VB4 application, and I ran into a terrible problem: something I never modified now gives me a totally unwanted "Invalid use of null" error. It happens...
6
by: drec | last post by:
I am just learning Javascript and I would like to create a basic form that gives me two options. This will be using either checkbox or radio input type, however I would like the second option to...
2
by: billsahiker | last post by:
I wrote a test program to help understand asynchronous calls in c#. I have a working VB.NET app that uses a similar technique but I cannot get it to work in c#. The errors I get and the code below....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.