Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One Codefile, two aspx pages = Publish Errors 1

Status
Not open for further replies.

ralphtrent

Programmer
Jun 2, 2003
958
US
Hope someone can help as this is annoying. I have been researching for hours and all the resolutions on the web about this topic have not helped me out.

I have created a mobilized version of a page by modifying the aspx page to display the data differently. I still have a normal page for non-mobile devices. I want to share the same code behind between these two pages.

I copied the one page, renamed him to "mobile", deleted the CodeFile that gets copied and modified the CodeFile attribute in the aspx page to point to the original file's code file. Doing so allows me to build and successfully test locally. When I attempt to publish the web app, I get the following error:
Code:
The type 'userControls_ticketWorknotes' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\onyxsupportreports\c8b6feb4\e5c61e59\App_Web_g40poipv.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\onyxsupportreports\c8b6feb4\e5c61e59\App_Web_4ytvvi52.dll'	C:\inetpub\[URL unfurl="true"]wwwroot\OnyxSupportReports\tickets\getTicketDetails_Mobile.aspx[/URL]

I have cleared out the temp internet dir and I have restarted IIS and VS2010. What irks me is that I am building for 3.5, not 4.0 so I am not sure why its trying to place in a 4.0 temp folder. Either way, I cannot get around this error unless I delete my mobilized pages.

any idea on how to resolve this? I assume what I want to do is pretty common, one codefile to multiple interfaces.

Thanks,
RalphTrent
 
Check the page declarations in the .aspx/.ascx files. Make sure they are pointing to the correct class and inheriting the correct page/uc
 
Ill map it out, please tell me if I am missing something.
The error i showed in the OP was just one of three, i have three places where this is happening:

PAGE 1

\userControls\ticketWorknotes.ascx
\userControls\ticketWorknotes.ascx.cs
\userControls\ticketWorknotes_mobile.ascx

ticketWorknotes.ascx Declaration
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ticketWorknotes.ascx.cs" Inherits="userControls_ticketWorknotes" %>

The mobile version of this page is ticketWorknotes_mobile.ascx
ticketWorknotes_mobile.ascx does not have a CodeFile under him in VS. His declaration looks like this:
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ticketWorknotes.ascx.cs" Inherits="userControls_ticketWorknotes" %>

ticketWorknotes.ascx.cs starts like this:
Code:
public partial class userControls_ticketWorknotes : System.Web.UI.UserControl

PAGE 2

\userControls\taskDetails.ascx
\userControls\taskDetails.ascx.cs
\userControls\taskDetails_mobile.ascx

taskDetails.ascx Declaration
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="taskDetails.ascx.cs" Inherits="userControls_taskDetails" %>

The mobile version of this page is taskDetails_mobile.ascx
taskDetails_mobile.ascx does not have a CodeFile under him in VS. His declaration looks like this:
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="taskDetails.ascx.cs" Inherits="userControls_taskDetails" %>

taskDetails.ascx.cs starts like this:
Code:
public partial class userControls_taskDetails : System.Web.UI.UserControl

Page 3

\userControls\incidentDetails.ascx
\userControls\incidentDetails.ascx.cs
\userControls\incidentDetails_mobile.ascx

incidentDetails.ascx Declaration
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="incidentDetails.ascx.cs" Inherits="userControls_incidentDetails" %>

The mobile version of this page is incidentDetails_mobile.ascx
incidentDetails_mobile.ascx does not have a CodeFile under him in VS. His declaration looks like this:
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="incidentDetails.ascx.cs" Inherits="userControls_incidentDetails" %>

incidentDetails.ascx.cs starts like this:
Code:
public partial class userControls_incidentDetails : System.Web.UI.UserControl

To me, i believe everything is setup correctly. Am I mistaken?
 
it sounds like a caching problem with the compiled dlls. have you deleted all the files in [tt]c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\onyxsupportreports\[/tt]?

it's probably running against .net 4.0 because that is was IIS was directed to use. locally you are using 3.5 though.

also are you developing this as a website or web application? It looks like a website with auto-generated dlls. I would highly recommend a web application. the code is compiled prior to deployment and the a single dll (per project) is created. you then have full control over the dll and you aren't trusting the computer to handle it for you.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Hey J, I have deleted all the files in that directory any any other temp that it may be hitting. I just do a search for the folder its creating and then delete them all. I have checked IIS and the application lives in a 2.0 app pool and the project it self is set to build to 3.5. I am not too concerned with the temp folder location though. I will look to convert it to a web app as this was a 2.0 VS 2008 project converted to 3.5 2010 project.

Ill see if that makes any difference, may be a few days though.

Thanks,
RalphTrent
 
it shouldn't. 3.5 is just wpf, wcf, & wwf. it still targets the 2.0 framework.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Thank J, I made it a web app and the problem went away.

As always, thanks,
RalphTrent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top