How can i have two concurrent web apps running on VS2008/VSS8.0/ASP.NET/IIS for a trunk and branch version? - asp.net

Applications I am using:
Visual Studio 2008 (C#/ASP.NET)
Visual Source Safe 8.0
IIS 5.1
I have two Web Apps both named the same but one is used for major releases and the other is for minor (trunk and branch). I am wondering if there is an option in Visual Studio that prevents it from creating an ASP.NET app in IIS using the web app's project name. Since both of them are named the same I have to go into IIS and change the path of the application so that it point to the major (or minor) folder when i go between the two.
What I would like to do is have something like this:
http://localhost/webapp_major
http://localhost/webapp_minor
but the web projects still have the same name. I know I can go into the properties of the each project file and have them point to different places but I think that breaks something when you want to merge between the two.
Any Ideas would be very appreciated.

Instead of having HTTP based projects in your visual studio solution, add them as file projects, where the website will be accessed as c:\inetput\wwwroot\major_version (for example) in visual studio (and not http://localhost). That way you can have any kind of setup you want in IIS and your projects won't conflict when you merge them.

Your web application project will let you name the Virtual Directory anything you want. VS2008 extends this by allowing you to set this on a per-user basis, so this information won't be saved in the project file, and therefore won't be propagated to source control.

You can manually create a new web application in IIS and let it point to your working directory. Visual Studio should honor these settings.

Related

Pull iis .net sites into visual studio

I've recently inherited some old code that needs some work, and I need to know how to pull existing iis websites into visual studio (2017 pro) so I can work on them. There's 6 iis sites I need to pull in, and any given site can have 0 or more iis applications and virtual directories associated to it. I've seen the option to add an existing website to a VS solution, and also saw how to assign virtual directories to individual projects. My questions are:
How do we handle iis applications within a site in visual studio?
Can all 6 sites be pulled into a single solution? This would be ideal if possible
Is there a way to pull in iis site settings into the projects/ solution? I'm talking about the config data stored in the applicationHost.config
Update- I've got the raw source code, in addition to the bins in these iis site directories. I don't have a need to decompile, just need to pull them back into visual studio.

Deploy website from a Windows XP Desktop

On my Windows XP desktop, I have a fairly simple ASP.NET targetting .net 4 in Visual Studio 2010. I can run it on my local host by ctrl + F5, it works all fine.
I have a Windows Server 2003, that I can access via mstsc, but also via Explorer. When I go to the publish section of my build properties, i see 4 publish methods :
Web Deploy, FTP, File System, FPSE
I have already installed IIS 6 successfully on the Windows Server, and given all authorizations for everything I could so far (to get things to work in the first place, will check on that later).
How should I proceed to publish to that remote machine ? Should I target a specific folder ? Do I need to setup things in IIS 6 for that site first ? Or will it all get settled from te properties I have in Visual Studio ?
Thank you guys,
J.
Personally I've always plumped for a manual deployment; that is I create the Web Site in IIS creating an appropriate AppPool and targeting the correct .NET version to utilise. From there simply copy (xcopy if you will) the appropriate files over, e.g. DLL and all supporting pages such as ASPX, CSS and associated images. In most situations where I have direct / RDP access this is what I run with.
That said, this can be automated from Visual Studio and this can be useful for those situations where you're maintaining an awful lot of sites on a regular basis. With IIS 6 and Visual Studio, this was achieved by installing FrontPage Extensions on the server then utilising the Publish option.
For VS2010 it seems this has been streamlined using the IIS Web Deploy module and configuring the Studio to publish in this manner that looks mildly quick...
HTH
I've never used the Web Deploy feature in 2010, so I can't really tell you about its merits or drawbacks. I've read that it works much better with IIS7 than IIS6. If you have direct access to the IIS root folder on the server (typically c:\inetpub\wwwroot) through a network share I would recommend doing the file system deployment. FPSE works as well if you have to publish to the server through a remote URL, but there are some security issues with FPSE that make enabling it on your web server a less than ideal choice.
Once the files have been deployed, all that should be left is to configure the website as an application inside of IIS.
Remote in to the web server and open IIS
Right-click Default Web Site and choose properties (if you've deployed to a subfolder in the root, then locate that folder and choose those properties instead
Switch to the Home Directory tab (Just 'Directory' for a subfolder)
Look for the Application Settings section and click the button that says Create
Optional: Select an app pool if you have created a custom one from the default
That should enable IIS to execute your .aspx files inside of your application. Once you've successfully configured the app for the first time, you can just keep publishing your app to the same location over and over without having to reconfigure it.

How to deploy an ASP.NET web site

I have an ASP.Net website that I built in a computer science class. I built it in Visual Studio and the solution is on my local drive. How would I deploy this to a real website?
You will need to do a few things.
You will need to get a hosting account that supports ASP.NET
From there you can use the "Publish" option from within Visual Studio under the "Build" menu option to push out a copy of the site.
When publishing you should publish in release mode.
Get hosting that supports the version of .NET and ASP.NET you have used and copy the files over.
Assuming that already you have an IIS application and web folder set up on a web server somewhere, the simplest method goes like this:
In Visual Studio, right-click on the web application project, and click Publish.
Select File System as the publish method.
Select a target location. This is where the publishable files will be placed. Use c:\pub or something similar.
Hit Publish
Once the publish operation is done, copy everything in c:\pub (or whatever target folder you used in step 3) to your web folder on the web server. Depending on your server accessibility, you may need to do this via FTP.
You might also investigate ClickOnce Deployment if your server supports it.
If you don't already have server space, you'll need to find a good hosting provider that supports ASP.NET. Google has many suggestions.

IIS 6 to 7 is making me scared of web.configs

Hi guys,
We have a mixed development environment of three servers running: Win Server 2003 & 2008, IIS 7 & IIS 6, ASP.NET 2.0 & ASP.NET 3.5. Previously, all three servers were Server 03/IIS6/ASP.NET 2.0, but with this new change, I am finding that pushing/moving any applications from server to server is always a terrifying experience because there are always a variety of problems with the web.config from server to server. I used to consider myself a confident ASP.NET developer but now I am frightened to come to work every day.
I have always used the web.configs that VS generates for me on the Win 2003/ ASP.NET 2.0 server. None of our web.configs are "leet", they are just normal, although we do use ScriptManager and UpdatePanel.
To get by, as a temporary fix, I'm having to remember that when projects are moved/tested/deployed, never to move or overwrite any web.configs and things get confusing very fast. I've tried "ducttaping" like suggested here my web.configs with the new IIS7 stuff but even that doesn't work all the time.
What can I do here, what's going on? Is there a standard web.config that will work on all of the servers and do the UpdatePanel and ScriptManager ?
[edited question]
Since IIS6 is the baseline install for your application, you should make sure to run the application in "Classic" mode under IIS7. This makes configuration the same as an IIS6 box. This is how we run our web applications for now until we have fully migrated to 100% IIS7 server environments and we have zero problems with deployment/runtime.
To do this you can either choose to run your app under the built in "Classic .NET AppPool" that comes with IIS7 or, assuming you create your own custom application pools, just make sure you set the "Managed Pipeline Mode" to "Classic" under the "Advanced Settings" dialog for the app pool.
You should seriously look at web deployment projects for visual studio 2008.
This is an official add-on for Visual Studio that gives you a new project type called web deployment project. Among the most useful features is the ability to do web.config search/replace as well as pre-compiled builds of your web sites or web application projects.
In your case, what you'd do is create a solution configuration in visual studio for all of your target web servers. Then you'd create a web deployment project for your web app. In the properties for the deployment project you tell it how you want to compile the project and what web.config replacements you want to use for each solution configuration.
The end result should be that you can open Visual Studio, pick a solution configuration, build the deployment project. The build will create a folder with everything you need for that environment including the correctly configured web.config files. Then you just copy the folder to your server and you are up-and-running.
Best of all, since the different config files are all stored in the projecct, it lets you manage your configuration in one place and check it all into source control.
Do note that there is no equivalent in Visual Studio 2010. Instead, VS 2010 has a whole new deployment mechanism called MSDeploy. With 2010 you don't need a seperate project for deployments, and MSDeploy goes a lot further allowing you to package your SQL databases and other stuff too.
You can use the Classic mode under IIS6 by changing the process. That is actually pretty simple and it should work.
Another approach would be to automating your deployment process and have it so that it deploys the correct web.config to the server when you need to update your application.
If you run your IIS 7 websites using the Classic .NET App Pool, then the config files will match what you would use for IIS 6. That's probably the easiest thing to do until you're ready to migrate everything to IIS 7.
Knowledge is a great way to get over fear. Figure out what's going on (you're currently grasping at straws) and the fear will go away.
It's my guess that you'll do better if you refactor the code that uses the config file. Sloppiness there can definitely explain your weirdness and inconsistencies. You can't control much with your config settings if the code isn't behaving properly.

How can I use the "Publish" function in Visual Studio 2008 without erasing the contents of the target folder?

When I use Build->Publish Web Site in Visual Studio 2008, most of the time it compiles the site, and then simply asks me "All files in the target folder will be deleted. Continue?" (or something to that effect). On occasion, however, when publishing a project in Visual Studio, I would get a dialog box that would give me the choice of replacing the folder's contents completely, or simply replacing changed files with newer version.
I much prefer to publish without completely obliterating the folder, because the deployed application creates user files and cache files as it's been used that I don't want to take extra steps to preserve. However, I'm not sure why Visual Studio doesn't always give me this option. Is this a setting somewhere I can change? Is it tied to the version of .NET I'm using?
Any insight is appreciated!
Edit - Followup on 2009-01-20
I still haven't figured this out, but here's some more information.
Here's what the publish function looks like for one ASP.NET project on my Win XP desktop:
And here's what it looks like for a different project on my Vista laptop:
Notice the radio buttons in the second screenshot that allow me to choose to either delete the contents of the folder prior to publishing, or merely to overwrite matching files. I'd like to have these options for every project.
Both computers are running Visual Studio 2008 Professional (version 9.0.30729.1 SP, according to Help->About). The exact same version. And I doubt the OS difference is causing this functionality change. It's got to be a setting somewhere, right? Does anyone know?
John is right, the only difference is one of your projects is a Web Site Project and the other is a Web Application project. You will not see the "convert to web application" option unless you are in a Web Application project. I know... it is very misleading. The reason behind this stems from the the way you convert to a web application project. If you plan on converting it(which can be a real pain in arse, depending on how it is set up) then you need to be aware of a few differences:
In a Web Application project everything is pre-compiled all the codebehind pages will be compiled into a .dll ---- In a Web Site Project nothing in the project is pre-compiled, the compiler will compile everything to ensure it is valid but none of the compiled pages are uploaded. When a user first attempts to access the site each page is compiled into its own dll. This means in a Web Site Project you are able to upload a single codebehind file.
Namespaces - In a Web Application project namespaces are created by default in a Web Site Project they are not. So you may have to spend some time adding them if you plan on converting them.
Project files - you will notice that A Website Project does not have a "cproj" file a Web Application project does.
I have converted a few of these project I find they go fairly smooth as long as there is not a lot of code in the "app_code" folder. You can give it a try and see how easy it is, if it looks like it is going to be a pain, I would suggest FileZilla just FTP it and save yourself some headache.
Good Luck
That dialog is different for Web site projects and Web application projects. In my MVC projects (Web application projects), I see the additional options. In my regular ol' web site projects, I see the first dialog posted.
Not sure if this option will be suitable for you but you could use the copy website function from the solution explorer. Click on the "Copy Website" icon at the top of the solution explorer.
I think the real answer to your question is that you should put your user files and cache files somewhere else.
When publishing a web site Visual Studio is designed to make sure that the target folder contains your web site files, and absolutely nothing else.
Apparently this feature is coming in VS2010 - that's what Vishal Joshi announced at TechEd EMEA in session "PDC307: Microsoft Visual Studio 10: Web Development Futures"
The site has been updated from the site in the updated layer.

Resources