Last post Feb 04, 2008 10:02 AM by rkincaid
Jan 30, 2008 11:28 AM|rkincaid|LINK
I have inherited an application that was written in VS 2003, .Net 1.1. In that app, many of the aspx pages and ascx controls have code behind files in assemblies outside the web project. For example, the page called "ShowFriends.aspx" in the web project would
have a codebehind attribute of "ShowFriends.aspx.cs" but that class file would live in an assembly compiled to "AllCodeBehinds.dll" that is referenced in the web project in the references folder, but which class file does not physically live in the web project.
This app runs fine in the VS 2003/ .Net 1.1 world, but the web project will not convert to a web app because it cannot find the .cs file. In one sense, this seems logical as the actual class code is not available in the web project. However, obviously
VS 2003 was smart enough to find the code behind file in the external assembly.
Is there a trick to make this work in VS 2005? Or, <gulp>am I doomed to move every codebehind file into the web project</gulp>?
All help greatly appreciated, good answers richly rewarded.
Web Application Projects
visual studio 2005
visual studio .net 2003
Feb 04, 2008 02:45 AM|Benson Yu - MSFT|LINK
This app runs fine in the VS 2003/ .Net 1.1 world, but the web project will not convert to a web app because it cannot find the .cs file. In one sense, this seems logical as the actual class code is not available in the web project. However, obviously VS
2003 was smart enough to find the code behind file in the external assembly.
From your description, I understand that you have a VS.NET 2003 web project. It is a published web project since it doesn’t have any code behind files. Now you want to know how to convert this VS.NET 2003 web project to VS.NET 2005 web project. If I have
misunderstood your concern please let me know.
As far as I know, when we open a VS.NET 2003 project in VS.NET 2005 IDE, a
conversion wizard will start to convert the source files. It is make sense that the conversion does not work because lack of the codebehind files. Actually VS.NET 2003 can open the published web project but cannot modify any server code without the corresponding
files. For the same reason, conversion wizard cannot modify non-existing files either.
Feb 04, 2008 10:02 AM|rkincaid|LINK
Thank you for your reply. There is one misunderstanding - the VS 2003 is <b>not</b> a published web project. There are code behind files, but the code behind files live in a different assembly from that which the aspx page lives. From your reply, though,
it sounds like the answer is to copy the class files to the assembly where the aspx page resides, and change the page directive such that it refers to the code behind file in its assembly.
In VS 2003, I can open the project, and it will even find the code behind file when I right-click and ask to show code. In VS 2005, it says it cannot find the same code-behind file.
Thanks for your help thus far.