DalSoft / dalsoft-website-comments

0 stars 0 forks source link

blog/index.php/2009/09/12/converting-asp-dotnet-website-to-a-web-application-project/ #7

Open utterances-bot opened 3 months ago

utterances-bot commented 3 months ago

Blog | DalSoft Ltd

We're an established, highly capable development consultancy specialising in full stack development and DevOps.

https://www.dalsoft.co.uk/blog/index.php/2009/09/12/

DalSoft commented 3 months ago

Legacy Comments

aspfanboy says: October 15, 2009 at 7:19 pm Excellent article thanks, found the information about Profiles when using a project very useful.


lynda says: March 12, 2010 at 9:35 pm Thank you very much for this post. I want to convert my website project to web application project for the sole purpose of doing unit testing also. I am new to asp.net and unit testing. My current code files in App_Code don’t have a namespace. If I convert my website project to web application project: How to add namespace to my current classes of App_Code? Do I need to go inside of each file add namespace for each class? If I rename the App_Code to new LibaryClass in converted WAP project, should I gave it the same namespace name? Thank you very much! Best Regards Lynda


DalSoft says: March 13, 2010 at 10:18 am Yes all you need to do is move the .cs files to a new folder and add a namespace to them (just after your using statements). With regards to naming the folders and namespaces that’s up to you, generally I try to make it obvious for example, I use the namespace DalSoft.Infrastructure and a folder named Infrastructure for code that is for the Infrastructure of my site. You may also want to put reusable code in there own projects, this allows you to start creating your own reusable libraries which further promotes testability and separation of concerns.

Hope this helps,

Darran


R0man says: March 13, 2012 at 11:55 pm I’m using App$Code folder name for code/classes. In this case there is no problem within namespaces (they all remain MyPrj.App_Code.xyz)


Chris says: September 25, 2012 at 11:55 am Hi, Do you have any instructions on converting a Web Application to a Web Site. I have complete a project and realized that I should have developed it as a website as I need to deploy it on another machine.

Thanks


DalSoft says: October 1, 2012 at 3:06 pm Going from a web application to a web site shouldn’t be a problem, just create a new web site and copy the files from the web application project.

However it is just as easy to deploy a web application project as a web site.