Upgrade website to webapplication in visual studio 2010 while under source control - c#

I have a highly complicated web site that is under source control and has a long history. I would like to migrate this website into a web application project but I do not want to lose the source control history. We use Visual Studio 2010 and Team Foundation Server (Currently 2005 tfs but we are in the process of upgrading to 2010).
How can we create a webapplication project and migrate the files from the web application into it without losing the source control connections?

Is there a need to "migrate" the files to a new directory structure?
Seems to me that if you left all the files where they were, created a new WebApplication project, and just use "Add Existing Items" to add the files to it, that everything would be fine. All the files would stay in the same place, you'd have a brand new project file, and your history would be preserved on everything.

Related

Create new web app offline c# using Visual Studio

I notice (beginner) that when I generate a new .net web app in Visual Studio, it collects required packages from the web. I believe I need to connected to the web in order to create an app. Is there an offline mode where it stores the files needed?
When you create a new project, Visual studio will download the require NuGet packages (=dependencies) from the internet.
Technically you can add a local NuGet repository (=on your hard drive) but do you really want to do that?!
I found this article describing how to achieve that src

opening an existing old asp Web Site with DB for modification

I am NOT new to programming however new to c#, asp, and visual studio. For my course project I have to take a seniors existing code and add some more functionality to it to demonstrate my ability in Software Maintenance.
Bug Tracking or is my project and I have to select from two different project however they are old Web Site template and NOT Web Application.
Found a way to open them now I just help with basic SQL settings
all numbered images
Refer to picture and then read please. 2 sub-folders in the project folder, once contains code and the other contains DB files (Pic# 1-3). Pic-4 shows the SqlConnection ctor and Pic-5 is my problem.
Both project appear to be the web forms template, and appear to be the web site template approach, which doesn't have a CSPROJ or VBPROJ file for the project. If there is a solution, you can open it from there. So use Visual Studio or the web developer express tools, which are free.

Import a web application to IIS programmatically

I have a C# web application developed and web deploy ready - meaning I have the WebApp.Web.zip file ready. I have verified that manual import of this application in my IIS 7.0 manager works and I am able to run the application in the browser.
Open IIS Manager (cmd->inetmgr), and explore the "Sites -> Default Web Site", and click on "Import Application" on the Right menu under Deploy. Browse to the path of the AAA.Web.zip and click "open". Go through the Package Import wizard. Click on "Browse *:80".
I now want to programmatically do the import of this application in the local IIS Server. Could you help me with some pointers?
So If all that you want is to host your WebApplication in IIS, and you don't want to do it all the way manually.
There is a neat way to do so,
Create a WebSetup Project. i.e. Add a New Project into the Solution of your Existing WebApplication i.e. inside visual studio, Add New Project, go to
Other Project Types >>Setup And Deployment >> Visual Studio Installer >> Web Setup Project
Just add Primary Output and Content Files of your WebApplication to the Setup Project and you are done. All you have to do is to build your solution.
And inside the bin folder of your Setup Project, you will get an .exe, which upon installation, hosts the WebApplication in IIS.
see more about creating a setup Project in visual studio
atleast it is cleaner than WebDeploy Command Line Syntax
Just use the webdeploy command line in your buildscript or from a Process object
http://technet.microsoft.com/en-us/library/dd569106(v=ws.10).aspx
Microsoft basically doesn't let you hook in with an API, there are a few ways to hack through it, but honestly you'll be better off using the command line
see this old answer

converting a project based solution to projectless website asp.net

I have a rather large Web Application that I began to create using the "Web Projects" solution type in Visual Studio.
I now have a need to incorporate some legacy VB.NET into the application, but low and behold you cannot mix languages using the "web project" model. I have to use what is referred to as projectless development (which is basically just a single folder for the entire website).
Any idea on how I can covert a project to a projectless model?
I hope this makes sense...
Creating a web-site from a web application is relatively straight forward.
Open a new instance of visual studio
File > New Website
Select the folder that has your web application.
Visual studio will warn you that there is already a website containing files at that location.
Select Create a new web site at the existing location.
It will warn you that some files like Default.aspx exist. Choose not to replace them.
And you are done.
The reverse, creating a web application from a web site is difficult. So be sure before you make the change.

Properly using file Designer Files in ASP.NET Web Sites

I need to get existing web pages into an existing ASP.NET web site project in Visual Studio 2008. I simply tried to drag and drop the whole file folder content into the Visual Studio Solution Explorer or even to copy them into the web site folder.
Both ways, Visual Studio seems unable to map the .designer.cs files to the corresponding .aspx (or .master) file, even after restarting the whole IDE. The Solution Explorer entry looks in a way like this:
- Main.aspx
Main.aspx.cs
Main.aspx.designer.cs
Can I make Visual Studio file the designer-file below the aspx-file in any way? I strongly hope there is a simpler way than manually creating each file and copying and pasting the contents into each file by hand.
It sounds like you are trying to bring web application files into a web site. IIf that is the case, The designer files are not even needed. Just dont include them. They are generated and compiled in at runtime when the website runs.
Kind of partially self-answering my question:
In a web project - in contrast to a web site - it works perfectly through drag and drop onto the solution explorer, as I did for the web site before. To make the decision which type of "web site unit" to use there is another thread here on stackoverflow: ASP.NET Web Site or Web Project.
In a web site I can't even use YonahW's solution, because I can't just put files into the proper web site directory without causing them to be added to the web site automatically. Thanks to you anyway, YonahW. :-)
try copying the files through the filesystem and then right clicking on the project and selecting to add an existing item at which point you can choose all at once and this usually puts them in the proper places.

Categories

Resources