By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 738 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

Compile error when 2 pages use same codebehind file

P: n/a
I have 2 pages referencing the same codebehind file in my
project. Originally the pages referenced separate code
behind files. Once I changed the reference to the same
file, everything worked fine while the file was in the
project directory. When the obsolete file was removed
from the project directory, my application will no longer
compile. Can someone please help with this issue?

Thank in advance,
Tom
Nov 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Yes I did get an error message saying that the source
files of the obsolete pages cannot be found.

-----Original Message-----
Hi Tom,

Do you get an error when you compile? What's the error?

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly" <th*************@us.ssiworldwide.com>Sender: "Thomas Connolly" <th*************@us.ssiworldwide.com>Subject: Compile error when 2 pages use same codebehind fileDate: Fri, 25 Jul 2003 15:16:22 -0700
Lines: 10
Message-ID: <02****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNS+mGCgbv5w+SZStmdnoMjjLKCPA==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:162250NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

I have 2 pages referencing the same codebehind file in myproject. Originally the pages referenced separate code
behind files. Once I changed the reference to the same
file, everything worked fine while the file was in the
project directory. When the obsolete file was removed
from the project directory, my application will no longercompile. Can someone please help with this issue?

Thank in advance,
Tom


.

Nov 17 '05 #2

P: n/a
To be more specific, here is the error:
Source file 'C:\Inetpub\wwwroot\WYIRIS\FAQ_Txt.aspx.cs'
could not be opened ('The system cannot find the file
specified. ')
-----Original Message-----
Hi Tom,

Do you get an error when you compile? What's the error?

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly" <th*************@us.ssiworldwide.com>Sender: "Thomas Connolly" <th*************@us.ssiworldwide.com>Subject: Compile error when 2 pages use same codebehind fileDate: Fri, 25 Jul 2003 15:16:22 -0700
Lines: 10
Message-ID: <02****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNS+mGCgbv5w+SZStmdnoMjjLKCPA==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:162250NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

I have 2 pages referencing the same codebehind file in myproject. Originally the pages referenced separate code
behind files. Once I changed the reference to the same
file, everything worked fine while the file was in the
project directory. When the obsolete file was removed
from the project directory, my application will no longercompile. Can someone please help with this issue?

Thank in advance,
Tom


.

Nov 17 '05 #3

P: n/a
Open the .csproj and .sln files with a text editor, and search for
references to the obsolete file. I have had similar problems when deleting
unwanted code behind files.

Regards

Ron

"Thomas Connolly" <th*************@us.ssiworldwide.com> wrote in message
news:02****************************@phx.gbl...
I have 2 pages referencing the same codebehind file in my
project. Originally the pages referenced separate code
behind files. Once I changed the reference to the same
file, everything worked fine while the file was in the
project directory. When the obsolete file was removed
from the project directory, my application will no longer
compile. Can someone please help with this issue?

Thank in advance,
Tom

Nov 17 '05 #4

P: n/a
Tom,

Did you remove the reference from the Page directive? I'm asking because I
want to try and reproduce your problem and I haven't been able to do so. I
have two Webforms. I changed the second's Page directive to indicate that
the codebehind file is the first's codebehind file and I also changed the
class that it inherits. (Did you do that?) When I compile after deleting
the original codebehind, it works fine.

The only thing I can think of is that you did not change the class that
your Webform inherits from.

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly" <th*************@us.ssiworldwide.com>
Sender: "Thomas Connolly" <th*************@us.ssiworldwide.com>
References: <02****************************@phx.gbl> <x4**************@cpmsftngxa06.phx.gbl>Subject: RE: Compile error when 2 pages use same codebehind file
Date: Fri, 25 Jul 2003 15:53:48 -0700
Lines: 59
Message-ID: <1f****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNS/5vEu2SNKBrPRLWzprJFDjfryQ==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:162261
NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

To be more specific, here is the error:
Source file 'C:\Inetpub\wwwroot\WYIRIS\FAQ_Txt.aspx.cs'
could not be opened ('The system cannot find the file
specified. ')
-----Original Message-----
Hi Tom,

Do you get an error when you compile? What's the error?

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly"<th*************@us.ssiworldwide.com>Sender: "Thomas Connolly"<th*************@us.ssiworldwide.com>Subject: Compile error when 2 pages use same codebehindfileDate: Fri, 25 Jul 2003 15:16:22 -0700
Lines: 10
Message-ID: <02****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNS+mGCgbv5w+SZStmdnoMjjLKCPA==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gblmicrosoft.public.dotnet.framework.aspnet:162250NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

I have 2 pages referencing the same codebehind file inmyproject. Originally the pages referenced separate code
behind files. Once I changed the reference to the same
file, everything worked fine while the file was in the
project directory. When the obsolete file was removed
from the project directory, my application will nolongercompile. Can someone please help with this issue?

Thank in advance,
Tom


.


Nov 17 '05 #5

P: n/a
Yes I did change both the class and the code behind file
in the page directive. Keep in mind that in the IDE,
everything runs fine. Try this, keep aspx page 2
referencing the code behind file in aspx page 1. Delete
the obsolete code behind file from the original aspx page
2. save everything. Compile. Close the IDE and manually
navigate to the page using your browser. Does it load.
-----Original Message-----
Tom,

Did you remove the reference from the Page directive? I'm asking because Iwant to try and reproduce your problem and I haven't been able to do so. Ihave two Webforms. I changed the second's Page directive to indicate thatthe codebehind file is the first's codebehind file and I also changed theclass that it inherits. (Did you do that?) When I compile after deletingthe original codebehind, it works fine.

The only thing I can think of is that you did not change the class thatyour Webform inherits from.

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly" <th*************@us.ssiworldwide.com>Sender: "Thomas Connolly" <th*************@us.ssiworldwide.com>References: <02****************************@phx.gbl>

<x4**************@cpmsftngxa06.phx.gbl>
Subject: RE: Compile error when 2 pages use same codebehind fileDate: Fri, 25 Jul 2003 15:53:48 -0700
Lines: 59
Message-ID: <1f****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNS/5vEu2SNKBrPRLWzprJFDjfryQ==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:162261NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

To be more specific, here is the error:
Source file 'C:\Inetpub\wwwroot\WYIRIS\FAQ_Txt.aspx.cs'
could not be opened ('The system cannot find the file
specified. ')
-----Original Message-----
Hi Tom,

Do you get an error when you compile? What's the error?

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly"

<th*************@us.ssiworldwide.com>
Sender: "Thomas Connolly"

<th*************@us.ssiworldwide.com>
Subject: Compile error when 2 pages use same codebehind
file
Date: Fri, 25 Jul 2003 15:16:22 -0700
Lines: 10
Message-ID: <02****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MIMEOLE: Produced By Microsoft MimeOLE

V5.50.4910.0300Thread-Index: AcNS+mGCgbv5w+SZStmdnoMjjLKCPA==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.aspnet:16225 0
NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

I have 2 pages referencing the same codebehind file in

my
project. Originally the pages referenced separate codebehind files. Once I changed the reference to the samefile, everything worked fine while the file was in the
project directory. When the obsolete file was removed
from the project directory, my application will no

longer
compile. Can someone please help with this issue?

Thank in advance,
Tom
.


.

Nov 17 '05 #6

P: n/a
Tom,

I am replying here so that others can see the response.

What you need to do is open each one of these pages in VS.NET after you
move the old code behind. When you do, VS.NET will update project view
with the new code behind and will put a warning icon over the old code
behind. Right-click the old code behind with the warning icon and choose
delete. After you do this for each of your files, it will work fine.

Hope that helps.

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
X-Tomcat-ID: 459707228
References: <02****************************@phx.gbl> <x4**************@cpmsftngxa06.phx.gbl>
<1f****************************@phx.gbl>
<#T**************@cpmsftngxa06.phx.gbl>
<0a****************************@phx.gbl>MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire (MS))
Organization: Microsoft
Date: Mon, 28 Jul 2003 17:55:06 GMT
Subject: RE: Compile error when 2 pages use same codebehind file
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <fS**************@cpmsftngxa06.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 144
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:162716
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Tom,

Yes, both do load fine. If you have a project that you can zip up and
e-mail to me that exhibits this problem, I'll be glad to look into it for
you. You can e-mail me by leaving off the "online" in my e-mail address.

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly" <th*************@us.ssiworldwide.com>
Sender: "Thomas Connolly" <th*************@us.ssiworldwide.com>
References: <02****************************@phx.gbl>

<x4**************@cpmsftngxa06.phx.gbl>
<1f****************************@phx.gbl>
<#T**************@cpmsftngxa06.phx.gbl>
Subject: RE: Compile error when 2 pages use same codebehind file
Date: Mon, 28 Jul 2003 10:14:58 -0700
Lines: 129
Message-ID: <0a****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNVK8XFx7uTIkNmSl2Zm7EXh6SFiQ==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:162694
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Yes I did change both the class and the code behind file
in the page directive. Keep in mind that in the IDE,
everything runs fine. Try this, keep aspx page 2
referencing the code behind file in aspx page 1. Delete
the obsolete code behind file from the original aspx page
2. save everything. Compile. Close the IDE and manually
navigate to the page using your browser. Does it load.
-----Original Message-----
Tom,

Did you remove the reference from the Page directive?

I'm asking because I
want to try and reproduce your problem and I haven't been

able to do so. I
have two Webforms. I changed the second's Page directive

to indicate that
the codebehind file is the first's codebehind file and I

also changed the
class that it inherits. (Did you do that?) When I

compile after deleting
the original codebehind, it works fine.

The only thing I can think of is that you did not change

the class that
your Webform inherits from.

Jim Cheshire
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.


--------------------
Content-Class: urn:content-classes:message
From: "Thomas Connolly"

<th*************@us.ssiworldwide.com>
Sender: "Thomas Connolly"

<th*************@us.ssiworldwide.com>
References: <02****************************@phx.gbl>
<x4**************@cpmsftngxa06.phx.gbl>
Subject: RE: Compile error when 2 pages use same

codebehind file
Date: Fri, 25 Jul 2003 15:53:48 -0700
Lines: 59
Message-ID: <1f****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNS/5vEu2SNKBrPRLWzprJFDjfryQ==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.aspnet:16226 1
NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

To be more specific, here is the error:
Source file 'C:\Inetpub\wwwroot\WYIRIS\FAQ_Txt.aspx.cs'
could not be opened ('The system cannot find the file
specified. ')

>-----Original Message-----
>Hi Tom,
>
>Do you get an error when you compile? What's the error?
>
>Jim Cheshire
>Developer Support
>ASP.NET
>ja******@online.microsoft.com
>
>This post is provided as-is with no warranties and
confers no rights.
>
>--------------------
>>Content-Class: urn:content-classes:message
>>From: "Thomas Connolly"
<th*************@us.ssiworldwide.com>
>>Sender: "Thomas Connolly"
<th*************@us.ssiworldwide.com>
>>Subject: Compile error when 2 pages use same

codebehind
file
>>Date: Fri, 25 Jul 2003 15:16:22 -0700
>>Lines: 10
>>Message-ID: <02****************************@phx.gbl>
>>MIME-Version: 1.0
>>Content-Type: text/plain;
>> charset="iso-8859-1"
>>Content-Transfer-Encoding: 7bit
>>X-Newsreader: Microsoft CDO for Windows 2000
>>X-MIMEOLE: Produced By Microsoft MimeOLE

V5.50.4910.0300
>>Thread-Index: AcNS+mGCgbv5w+SZStmdnoMjjLKCPA==
>>Newsgroups: microsoft.public.dotnet.framework.aspnet
>>Path: cpmsftngxa06.phx.gbl
>>Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:16225 0
>>NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>>
>>I have 2 pages referencing the same codebehind file in
my
>>project. Originally the pages referenced separate

code
>>behind files. Once I changed the reference to the

same
>>file, everything worked fine while the file was in the
>>project directory. When the obsolete file was removed
>>from the project directory, my application will no
longer
>>compile. Can someone please help with this issue?
>>
>>Thank in advance,
>>Tom
>>
>
>.
>
.



Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.