I am trying to convert a Web Site Project to a Web Application Project. When I convert the project files, one of the steps renames the App_Code directory to Old_App_Code.
I have used the App_code directory to hold all of my .cs files for classes, utilities, and enumerations, etc. Then when I build the solution all of the classes I have defined can not be found in the calling aspx pages. So, how do I specify that these files
are in the Old_App_Code directory now? Do I have to make some kind of change to each aspx page that calls them (lots!) or is there some global setting that I can specify to now look in the Old_App_code directory?
I just ran into this issue myself. The conversion tool doesn't properly mark the code for compilation - it marks its Build Action as Content. Click on each .cs file in Old_App_Code (or highlight a bunch of them at a time) and in the Properties dialog,
change Build Action from Content to Compile.
WAPapp_code
Steven A Smith
http://SteveSmithBlog.com
http://Twitter.com/Ardalis
The Code Project (www.codeproject.com)
Founder, NimblePros (nimblepros.com)
Thanks for the tip, I had actually created a class library to hold the contents of Old_App_Code and it worked fine. I have tried your solution and it works as I had hoped in the first place. Now I have two ways to make it go. Thanks again for your help.
After creating the web project and copying your files into it, you right click on any given folder (or the whole project) and select "Convert To Web Application" (or something very close to this exact text) in Solution Explorer.
WAP
Steven A Smith
http://SteveSmithBlog.com
http://Twitter.com/Ardalis
The Code Project (www.codeproject.com)
Founder, NimblePros (nimblepros.com)
Claude Maxim
Member
157 Points
61 Posts
Web Site Project to WAP – App_Code directory conversion issue
Jan 19, 2007 03:10 PM|LINK
Hi All,
I am trying to convert a Web Site Project to a Web Application Project. When I convert the project files, one of the steps renames the App_Code directory to Old_App_Code. I have used the App_code directory to hold all of my .cs files for classes, utilities, and enumerations, etc. Then when I build the solution all of the classes I have defined can not be found in the calling aspx pages. So, how do I specify that these files are in the Old_App_Code directory now? Do I have to make some kind of change to each aspx page that calls them (lots!) or is there some global setting that I can specify to now look in the Old_App_code directory?
Thanks for your help,
Claude.
ASPSmith
Participant
1985 Points
219 Posts
ASPInsiders
MVP
Re: Web Site Project to WAP – App_Code directory conversion issue
Jan 23, 2007 08:01 PM|LINK
I just ran into this issue myself. The conversion tool doesn't properly mark the code for compilation - it marks its Build Action as Content. Click on each .cs file in Old_App_Code (or highlight a bunch of them at a time) and in the Properties dialog, change Build Action from Content to Compile.
WAP app_code
http://SteveSmithBlog.com
http://Twitter.com/Ardalis
The Code Project (www.codeproject.com)
Founder, NimblePros (nimblepros.com)
Claude Maxim
Member
157 Points
61 Posts
Re: Web Site Project to WAP – App_Code directory conversion issue
Jan 24, 2007 01:23 PM|LINK
Hi Steven,
Thanks for the tip, I had actually created a class library to hold the contents of Old_App_Code and it worked fine. I have tried your solution and it works as I had hoped in the first place. Now I have two ways to make it go. Thanks again for your help.
Claude.
ASPSmith
Participant
1985 Points
219 Posts
ASPInsiders
MVP
Re: Web Site Project to WAP – App_Code directory conversion issue
Jan 24, 2007 01:42 PM|LINK
You're welcome. I actually had a few other tips in the course of my own real-life project upgrade, which I added to my blog:
Web Application Project Conversion Tips
WAP Conversion
http://SteveSmithBlog.com
http://Twitter.com/Ardalis
The Code Project (www.codeproject.com)
Founder, NimblePros (nimblepros.com)
Claude Maxim
Member
157 Points
61 Posts
Re: Web Site Project to WAP – App_Code directory conversion issue
Jan 24, 2007 10:24 PM|LINK
Hi Steven,
A good read. My experience was very similar, and I concur that the builds are MUCH faster. Thanks again for your help and all the best!
Claude.
saintperez
Member
152 Points
90 Posts
Re: Web Site Project to WAP – App_Code directory conversion issue
Jun 06, 2007 06:39 PM|LINK
How do you go about converting a web Site to a WEB APP Using VS2005?
Systems Architect
Florida's Turnpike Enterprise
ASPSmith
Participant
1985 Points
219 Posts
ASPInsiders
MVP
Re: Web Site Project to WAP – App_Code directory conversion issue
Jun 07, 2007 01:15 PM|LINK
After creating the web project and copying your files into it, you right click on any given folder (or the whole project) and select "Convert To Web Application" (or something very close to this exact text) in Solution Explorer.
WAP
http://SteveSmithBlog.com
http://Twitter.com/Ardalis
The Code Project (www.codeproject.com)
Founder, NimblePros (nimblepros.com)
MNF
Member
261 Points
73 Posts
Re: Web Site Project to WAP – App_Code directory conversion issue
Nov 11, 2008 01:24 AM|LINK
Files in OLD_APP_CODE have Build Action as Content. It's not expected and not mentioned in http://webproject.scottgu.com/CSharp/migration2/migration2.aspx
Is it described in some other documention? I am not sure is it fixed in VS 2008.
I've posted a suggestion in MS feedback https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=381149
My Blog: http://geekswithblogs.net/mnf/
MNF
Member
261 Points
73 Posts
Re: Web Site Project to WAP – App_Code directory conversion issue
Nov 13, 2008 04:05 PM|LINK
According to Rick Strahl ,VS 2008 doesn't have conversion wizard at all. The process has become fully manual-see From ASP Stock Projects to Web Application Projects in VS 2008
My Blog: http://geekswithblogs.net/mnf/